twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 1 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 2 | * Copyright 2011 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 8 | #ifndef GrGLInterface_DEFINED |
| 9 | #define GrGLInterface_DEFINED |
| 10 | |
bsalomon@google.com | 637d5e9 | 2012-05-07 21:33:56 +0000 | [diff] [blame] | 11 | #include "GrGLFunctions.h" |
commit-bot@chromium.org | 90313cc | 2014-01-17 15:05:38 +0000 | [diff] [blame] | 12 | #include "GrGLExtensions.h" |
commit-bot@chromium.org | a4de8c2 | 2013-09-09 13:38:37 +0000 | [diff] [blame] | 13 | #include "SkRefCnt.h" |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 14 | |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 15 | //////////////////////////////////////////////////////////////////////////////// |
| 16 | |
Brian Salomon | 3d6801e | 2017-12-11 10:06:31 -0500 | [diff] [blame] | 17 | typedef void(*GrGLFuncPtr)(); |
| 18 | struct GrGLInterface; |
| 19 | |
| 20 | |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 21 | /** |
bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 22 | * Rather than depend on platform-specific GL headers and libraries, we require |
| 23 | * the client to provide a struct of GL function pointers. This struct can be |
Brian Salomon | c1b9c10 | 2018-04-06 09:18:00 -0400 | [diff] [blame^] | 24 | * specified per-GrContext as a parameter to GrContext::MakeGL. If no interface is |
| 25 | * passed to MakeGL then a default GL interface is created using GrGLMakeNativeInterface(). |
| 26 | * If this returns nullptr then GrContext::MakeGL() will fail. |
bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 27 | * |
Brian Salomon | c1b9c10 | 2018-04-06 09:18:00 -0400 | [diff] [blame^] | 28 | * The implementation of GrGLMakeNativeInterface is platform-specific. Several |
| 29 | * implementations have been provided (for GLX, WGL, EGL, etc), along with an |
| 30 | * implementation that simply returns nullptr. Clients should select the most |
| 31 | * appropriate one to build. |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 32 | */ |
Brian Salomon | 3d6801e | 2017-12-11 10:06:31 -0500 | [diff] [blame] | 33 | SK_API sk_sp<const GrGLInterface> GrGLMakeNativeInterface(); |
| 34 | // Deprecated alternative to GrGLMakeNativeInterface(). |
halcanary | 0fc1dbe | 2015-09-21 08:22:19 -0700 | [diff] [blame] | 35 | SK_API const GrGLInterface* GrGLCreateNativeInterface(); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 36 | |
bsalomon@google.com | 7491372 | 2011-10-27 20:44:19 +0000 | [diff] [blame] | 37 | /** |
| 38 | * Creates a null GrGLInterface that doesn't draw anything. Used for measuring |
bsalomon | 3724e57 | 2016-03-30 18:56:19 -0700 | [diff] [blame] | 39 | * CPU overhead. TODO: We would like to move this to tools/gpu/gl/null but currently |
| 40 | * Chromium is using it in its unit tests. |
bsalomon@google.com | 7491372 | 2011-10-27 20:44:19 +0000 | [diff] [blame] | 41 | */ |
svaisanen | b988ecf | 2016-04-20 00:36:53 -0700 | [diff] [blame] | 42 | const SK_API GrGLInterface* GrGLCreateNullInterface(bool enableNVPR = false); |
bsalomon@google.com | 7491372 | 2011-10-27 20:44:19 +0000 | [diff] [blame] | 43 | |
commit-bot@chromium.org | d8ed851 | 2014-01-24 20:49:44 +0000 | [diff] [blame] | 44 | /** |
bsalomon@google.com | cc61b17 | 2012-05-07 21:45:48 +0000 | [diff] [blame] | 45 | * GrContext uses the following interface to make all calls into OpenGL. When a |
| 46 | * GrContext is created it is given a GrGLInterface. The interface's function |
| 47 | * pointers must be valid for the OpenGL context associated with the GrContext. |
| 48 | * On some platforms, such as Windows, function pointers for OpenGL extensions |
| 49 | * may vary between OpenGL contexts. So the caller must be careful to use a |
| 50 | * GrGLInterface initialized for the correct context. All functions that should |
| 51 | * be available based on the OpenGL's version and extension string must be |
| 52 | * non-NULL or GrContext creation will fail. This can be tested with the |
| 53 | * validate() method when the OpenGL context has been made current. |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 54 | */ |
commit-bot@chromium.org | a4de8c2 | 2013-09-09 13:38:37 +0000 | [diff] [blame] | 55 | struct SK_API GrGLInterface : public SkRefCnt { |
bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 56 | private: |
commit-bot@chromium.org | a4de8c2 | 2013-09-09 13:38:37 +0000 | [diff] [blame] | 57 | typedef SkRefCnt INHERITED; |
robertphillips@google.com | 15e9d3e | 2012-06-21 20:25:03 +0000 | [diff] [blame] | 58 | |
bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 59 | public: |
bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 60 | GrGLInterface(); |
| 61 | |
commit-bot@chromium.org | 9e90aed | 2014-01-16 16:35:09 +0000 | [diff] [blame] | 62 | // Validates that the GrGLInterface supports its advertised standard. This means the necessary |
| 63 | // function pointers have been initialized for both the GL version and any advertised |
| 64 | // extensions. |
| 65 | bool validate() const; |
bsalomon@google.com | 89ec61e | 2012-02-10 20:05:18 +0000 | [diff] [blame] | 66 | |
commit-bot@chromium.org | 9e90aed | 2014-01-16 16:35:09 +0000 | [diff] [blame] | 67 | // Indicates the type of GL implementation |
| 68 | union { |
| 69 | GrGLStandard fStandard; |
| 70 | GrGLStandard fBindingsExported; // Legacy name, will be remove when Chromium is updated. |
| 71 | }; |
twiz@google.com | b65e0cb | 2011-03-18 20:41:44 +0000 | [diff] [blame] | 72 | |
commit-bot@chromium.org | 90313cc | 2014-01-17 15:05:38 +0000 | [diff] [blame] | 73 | GrGLExtensions fExtensions; |
| 74 | |
commit-bot@chromium.org | f535561 | 2014-02-28 20:28:50 +0000 | [diff] [blame] | 75 | bool hasExtension(const char ext[]) const { return fExtensions.has(ext); } |
commit-bot@chromium.org | 90313cc | 2014-01-17 15:05:38 +0000 | [diff] [blame] | 76 | |
commit-bot@chromium.org | c72425a | 2014-01-21 16:09:18 +0000 | [diff] [blame] | 77 | /** |
| 78 | * The function pointers are in a struct so that we can have a compiler generated assignment |
| 79 | * operator. |
| 80 | */ |
| 81 | struct Functions { |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 82 | GrGLFunction<GrGLActiveTextureProc> fActiveTexture; |
| 83 | GrGLFunction<GrGLAttachShaderProc> fAttachShader; |
| 84 | GrGLFunction<GrGLBeginQueryProc> fBeginQuery; |
| 85 | GrGLFunction<GrGLBindAttribLocationProc> fBindAttribLocation; |
| 86 | GrGLFunction<GrGLBindBufferProc> fBindBuffer; |
| 87 | GrGLFunction<GrGLBindFragDataLocationProc> fBindFragDataLocation; |
| 88 | GrGLFunction<GrGLBindFragDataLocationIndexedProc> fBindFragDataLocationIndexed; |
| 89 | GrGLFunction<GrGLBindFramebufferProc> fBindFramebuffer; |
| 90 | GrGLFunction<GrGLBindRenderbufferProc> fBindRenderbuffer; |
| 91 | GrGLFunction<GrGLBindTextureProc> fBindTexture; |
| 92 | GrGLFunction<GrGLBindVertexArrayProc> fBindVertexArray; |
| 93 | GrGLFunction<GrGLBlendBarrierProc> fBlendBarrier; |
| 94 | GrGLFunction<GrGLBlendColorProc> fBlendColor; |
| 95 | GrGLFunction<GrGLBlendEquationProc> fBlendEquation; |
| 96 | GrGLFunction<GrGLBlendFuncProc> fBlendFunc; |
| 97 | GrGLFunction<GrGLBlitFramebufferProc> fBlitFramebuffer; |
| 98 | GrGLFunction<GrGLBufferDataProc> fBufferData; |
| 99 | GrGLFunction<GrGLBufferSubDataProc> fBufferSubData; |
| 100 | GrGLFunction<GrGLCheckFramebufferStatusProc> fCheckFramebufferStatus; |
| 101 | GrGLFunction<GrGLClearProc> fClear; |
| 102 | GrGLFunction<GrGLClearColorProc> fClearColor; |
| 103 | GrGLFunction<GrGLClearStencilProc> fClearStencil; |
Brian Salomon | d17b4a6 | 2017-05-23 16:53:47 -0400 | [diff] [blame] | 104 | GrGLFunction<GrGLClearTexImageProc> fClearTexImage; |
| 105 | GrGLFunction<GrGLClearTexSubImageProc> fClearTexSubImage; |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 106 | GrGLFunction<GrGLColorMaskProc> fColorMask; |
| 107 | GrGLFunction<GrGLCompileShaderProc> fCompileShader; |
| 108 | GrGLFunction<GrGLCompressedTexImage2DProc> fCompressedTexImage2D; |
| 109 | GrGLFunction<GrGLCompressedTexSubImage2DProc> fCompressedTexSubImage2D; |
| 110 | GrGLFunction<GrGLCopyTexSubImage2DProc> fCopyTexSubImage2D; |
| 111 | GrGLFunction<GrGLCreateProgramProc> fCreateProgram; |
| 112 | GrGLFunction<GrGLCreateShaderProc> fCreateShader; |
| 113 | GrGLFunction<GrGLCullFaceProc> fCullFace; |
| 114 | GrGLFunction<GrGLDeleteBuffersProc> fDeleteBuffers; |
| 115 | GrGLFunction<GrGLDeleteFramebuffersProc> fDeleteFramebuffers; |
| 116 | GrGLFunction<GrGLDeleteProgramProc> fDeleteProgram; |
| 117 | GrGLFunction<GrGLDeleteQueriesProc> fDeleteQueries; |
| 118 | GrGLFunction<GrGLDeleteRenderbuffersProc> fDeleteRenderbuffers; |
| 119 | GrGLFunction<GrGLDeleteShaderProc> fDeleteShader; |
| 120 | GrGLFunction<GrGLDeleteTexturesProc> fDeleteTextures; |
| 121 | GrGLFunction<GrGLDeleteVertexArraysProc> fDeleteVertexArrays; |
| 122 | GrGLFunction<GrGLDepthMaskProc> fDepthMask; |
| 123 | GrGLFunction<GrGLDisableProc> fDisable; |
| 124 | GrGLFunction<GrGLDisableVertexAttribArrayProc> fDisableVertexAttribArray; |
| 125 | GrGLFunction<GrGLDrawArraysProc> fDrawArrays; |
| 126 | GrGLFunction<GrGLDrawArraysIndirectProc> fDrawArraysIndirect; |
| 127 | GrGLFunction<GrGLDrawArraysInstancedProc> fDrawArraysInstanced; |
| 128 | GrGLFunction<GrGLDrawBufferProc> fDrawBuffer; |
| 129 | GrGLFunction<GrGLDrawBuffersProc> fDrawBuffers; |
| 130 | GrGLFunction<GrGLDrawElementsProc> fDrawElements; |
| 131 | GrGLFunction<GrGLDrawElementsIndirectProc> fDrawElementsIndirect; |
| 132 | GrGLFunction<GrGLDrawElementsInstancedProc> fDrawElementsInstanced; |
bsalomon | fc9527a | 2016-08-29 09:18:39 -0700 | [diff] [blame] | 133 | GrGLFunction<GrGLDrawRangeElementsProc> fDrawRangeElements; |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 134 | GrGLFunction<GrGLEnableProc> fEnable; |
| 135 | GrGLFunction<GrGLEnableVertexAttribArrayProc> fEnableVertexAttribArray; |
| 136 | GrGLFunction<GrGLEndQueryProc> fEndQuery; |
| 137 | GrGLFunction<GrGLFinishProc> fFinish; |
| 138 | GrGLFunction<GrGLFlushProc> fFlush; |
| 139 | GrGLFunction<GrGLFlushMappedBufferRangeProc> fFlushMappedBufferRange; |
| 140 | GrGLFunction<GrGLFramebufferRenderbufferProc> fFramebufferRenderbuffer; |
| 141 | GrGLFunction<GrGLFramebufferTexture2DProc> fFramebufferTexture2D; |
| 142 | GrGLFunction<GrGLFramebufferTexture2DMultisampleProc> fFramebufferTexture2DMultisample; |
| 143 | GrGLFunction<GrGLFrontFaceProc> fFrontFace; |
| 144 | GrGLFunction<GrGLGenBuffersProc> fGenBuffers; |
| 145 | GrGLFunction<GrGLGenFramebuffersProc> fGenFramebuffers; |
| 146 | GrGLFunction<GrGLGenerateMipmapProc> fGenerateMipmap; |
| 147 | GrGLFunction<GrGLGenQueriesProc> fGenQueries; |
| 148 | GrGLFunction<GrGLGenRenderbuffersProc> fGenRenderbuffers; |
| 149 | GrGLFunction<GrGLGenTexturesProc> fGenTextures; |
| 150 | GrGLFunction<GrGLGenVertexArraysProc> fGenVertexArrays; |
| 151 | GrGLFunction<GrGLGetBufferParameterivProc> fGetBufferParameteriv; |
| 152 | GrGLFunction<GrGLGetErrorProc> fGetError; |
| 153 | GrGLFunction<GrGLGetFramebufferAttachmentParameterivProc> fGetFramebufferAttachmentParameteriv; |
| 154 | GrGLFunction<GrGLGetIntegervProc> fGetIntegerv; |
cdalton | eb79eea | 2016-02-26 10:39:34 -0800 | [diff] [blame] | 155 | GrGLFunction<GrGLGetMultisamplefvProc> fGetMultisamplefv; |
Ethan Nicholas | d1b2eec | 2017-11-01 15:45:43 -0400 | [diff] [blame] | 156 | GrGLFunction<GrGLGetProgramBinaryProc> fGetProgramBinary; |
| 157 | GrGLFunction<GrGLGetProgramInfoLogProc> fGetProgramInfoLog; |
| 158 | GrGLFunction<GrGLGetProgramivProc> fGetProgramiv; |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 159 | GrGLFunction<GrGLGetQueryObjecti64vProc> fGetQueryObjecti64v; |
| 160 | GrGLFunction<GrGLGetQueryObjectivProc> fGetQueryObjectiv; |
| 161 | GrGLFunction<GrGLGetQueryObjectui64vProc> fGetQueryObjectui64v; |
| 162 | GrGLFunction<GrGLGetQueryObjectuivProc> fGetQueryObjectuiv; |
| 163 | GrGLFunction<GrGLGetQueryivProc> fGetQueryiv; |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 164 | GrGLFunction<GrGLGetRenderbufferParameterivProc> fGetRenderbufferParameteriv; |
| 165 | GrGLFunction<GrGLGetShaderInfoLogProc> fGetShaderInfoLog; |
| 166 | GrGLFunction<GrGLGetShaderivProc> fGetShaderiv; |
| 167 | GrGLFunction<GrGLGetShaderPrecisionFormatProc> fGetShaderPrecisionFormat; |
| 168 | GrGLFunction<GrGLGetStringProc> fGetString; |
| 169 | GrGLFunction<GrGLGetStringiProc> fGetStringi; |
| 170 | GrGLFunction<GrGLGetTexLevelParameterivProc> fGetTexLevelParameteriv; |
| 171 | GrGLFunction<GrGLGetUniformLocationProc> fGetUniformLocation; |
| 172 | GrGLFunction<GrGLInsertEventMarkerProc> fInsertEventMarker; |
| 173 | GrGLFunction<GrGLInvalidateBufferDataProc> fInvalidateBufferData; |
| 174 | GrGLFunction<GrGLInvalidateBufferSubDataProc> fInvalidateBufferSubData; |
| 175 | GrGLFunction<GrGLInvalidateFramebufferProc> fInvalidateFramebuffer; |
| 176 | GrGLFunction<GrGLInvalidateSubFramebufferProc> fInvalidateSubFramebuffer; |
| 177 | GrGLFunction<GrGLInvalidateTexImageProc> fInvalidateTexImage; |
| 178 | GrGLFunction<GrGLInvalidateTexSubImageProc> fInvalidateTexSubImage; |
| 179 | GrGLFunction<GrGLIsTextureProc> fIsTexture; |
| 180 | GrGLFunction<GrGLLineWidthProc> fLineWidth; |
| 181 | GrGLFunction<GrGLLinkProgramProc> fLinkProgram; |
Ethan Nicholas | d1b2eec | 2017-11-01 15:45:43 -0400 | [diff] [blame] | 182 | GrGLFunction<GrGLProgramBinaryProc> fProgramBinary; |
| 183 | GrGLFunction<GrGLProgramParameteriProc> fProgramParameteri; |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 184 | GrGLFunction<GrGLMapBufferProc> fMapBuffer; |
| 185 | GrGLFunction<GrGLMapBufferRangeProc> fMapBufferRange; |
| 186 | GrGLFunction<GrGLMapBufferSubDataProc> fMapBufferSubData; |
| 187 | GrGLFunction<GrGLMapTexSubImage2DProc> fMapTexSubImage2D; |
csmartdalton | 5cebf8c | 2016-06-03 08:28:47 -0700 | [diff] [blame] | 188 | GrGLFunction<GrGLMultiDrawArraysIndirectProc> fMultiDrawArraysIndirect; |
| 189 | GrGLFunction<GrGLMultiDrawElementsIndirectProc> fMultiDrawElementsIndirect; |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 190 | GrGLFunction<GrGLPixelStoreiProc> fPixelStorei; |
Jim Van Verth | 609e7cc | 2017-03-30 14:28:08 -0400 | [diff] [blame] | 191 | GrGLFunction<GrGLPolygonModeProc> fPolygonMode; |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 192 | GrGLFunction<GrGLPopGroupMarkerProc> fPopGroupMarker; |
| 193 | GrGLFunction<GrGLPushGroupMarkerProc> fPushGroupMarker; |
| 194 | GrGLFunction<GrGLQueryCounterProc> fQueryCounter; |
| 195 | GrGLFunction<GrGLRasterSamplesProc> fRasterSamples; |
| 196 | GrGLFunction<GrGLReadBufferProc> fReadBuffer; |
| 197 | GrGLFunction<GrGLReadPixelsProc> fReadPixels; |
| 198 | GrGLFunction<GrGLRenderbufferStorageProc> fRenderbufferStorage; |
commit-bot@chromium.org | a8e5a06 | 2013-09-05 23:44:09 +0000 | [diff] [blame] | 199 | |
commit-bot@chromium.org | c72425a | 2014-01-21 16:09:18 +0000 | [diff] [blame] | 200 | // On OpenGL ES there are multiple incompatible extensions that add support for MSAA |
| 201 | // and ES3 adds MSAA support to the standard. On an ES3 driver we may still use the |
| 202 | // older extensions for performance reasons or due to ES3 driver bugs. We want the function |
| 203 | // that creates the GrGLInterface to provide all available functions and internally |
| 204 | // we will select among them. They all have a method called glRenderbufferStorageMultisample*. |
| 205 | // So we have separate function pointers for GL_IMG/EXT_multisampled_to_texture, |
| 206 | // GL_CHROMIUM/ANGLE_framebuffer_multisample/ES3, and GL_APPLE_framebuffer_multisample |
| 207 | // variations. |
| 208 | // |
| 209 | // If a driver supports multiple GL_ARB_framebuffer_multisample-style extensions then we will |
| 210 | // assume the function pointers for the standard (or equivalent GL_ARB) version have |
| 211 | // been preferred over GL_EXT, GL_CHROMIUM, or GL_ANGLE variations that have reduced |
| 212 | // functionality. |
commit-bot@chromium.org | a8e5a06 | 2013-09-05 23:44:09 +0000 | [diff] [blame] | 213 | |
commit-bot@chromium.org | c72425a | 2014-01-21 16:09:18 +0000 | [diff] [blame] | 214 | // GL_EXT_multisampled_render_to_texture (preferred) or GL_IMG_multisampled_render_to_texture |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 215 | GrGLFunction<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisampleES2EXT; |
commit-bot@chromium.org | c72425a | 2014-01-21 16:09:18 +0000 | [diff] [blame] | 216 | // GL_APPLE_framebuffer_multisample |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 217 | GrGLFunction<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisampleES2APPLE; |
commit-bot@chromium.org | 92b7884 | 2014-01-16 20:49:46 +0000 | [diff] [blame] | 218 | |
commit-bot@chromium.org | c72425a | 2014-01-21 16:09:18 +0000 | [diff] [blame] | 219 | // This is used to store the pointer for GL_ARB/EXT/ANGLE/CHROMIUM_framebuffer_multisample or |
| 220 | // the standard function in ES3+ or GL 3.0+. |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 221 | GrGLFunction<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisample; |
commit-bot@chromium.org | a8e5a06 | 2013-09-05 23:44:09 +0000 | [diff] [blame] | 222 | |
commit-bot@chromium.org | c72425a | 2014-01-21 16:09:18 +0000 | [diff] [blame] | 223 | // Pointer to BindUniformLocationCHROMIUM from the GL_CHROMIUM_bind_uniform_location extension. |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 224 | GrGLFunction<GrGLBindUniformLocationProc> fBindUniformLocation; |
commit-bot@chromium.org | d3baf20 | 2013-11-07 22:06:08 +0000 | [diff] [blame] | 225 | |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 226 | GrGLFunction<GrGLResolveMultisampleFramebufferProc> fResolveMultisampleFramebuffer; |
| 227 | GrGLFunction<GrGLScissorProc> fScissor; |
| 228 | GrGLFunction<GrGLShaderSourceProc> fShaderSource; |
| 229 | GrGLFunction<GrGLStencilFuncProc> fStencilFunc; |
| 230 | GrGLFunction<GrGLStencilFuncSeparateProc> fStencilFuncSeparate; |
| 231 | GrGLFunction<GrGLStencilMaskProc> fStencilMask; |
| 232 | GrGLFunction<GrGLStencilMaskSeparateProc> fStencilMaskSeparate; |
| 233 | GrGLFunction<GrGLStencilOpProc> fStencilOp; |
| 234 | GrGLFunction<GrGLStencilOpSeparateProc> fStencilOpSeparate; |
cdalton | c04ce67 | 2016-03-11 14:07:38 -0800 | [diff] [blame] | 235 | GrGLFunction<GrGLTexBufferProc> fTexBuffer; |
cdalton | f8a6ce8 | 2016-04-11 13:02:05 -0700 | [diff] [blame] | 236 | GrGLFunction<GrGLTexBufferRangeProc> fTexBufferRange; |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 237 | GrGLFunction<GrGLTexImage2DProc> fTexImage2D; |
| 238 | GrGLFunction<GrGLTexParameteriProc> fTexParameteri; |
| 239 | GrGLFunction<GrGLTexParameterivProc> fTexParameteriv; |
| 240 | GrGLFunction<GrGLTexSubImage2DProc> fTexSubImage2D; |
| 241 | GrGLFunction<GrGLTexStorage2DProc> fTexStorage2D; |
| 242 | GrGLFunction<GrGLTextureBarrierProc> fTextureBarrier; |
| 243 | GrGLFunction<GrGLDiscardFramebufferProc> fDiscardFramebuffer; |
| 244 | GrGLFunction<GrGLUniform1fProc> fUniform1f; |
| 245 | GrGLFunction<GrGLUniform1iProc> fUniform1i; |
| 246 | GrGLFunction<GrGLUniform1fvProc> fUniform1fv; |
| 247 | GrGLFunction<GrGLUniform1ivProc> fUniform1iv; |
| 248 | GrGLFunction<GrGLUniform2fProc> fUniform2f; |
| 249 | GrGLFunction<GrGLUniform2iProc> fUniform2i; |
| 250 | GrGLFunction<GrGLUniform2fvProc> fUniform2fv; |
| 251 | GrGLFunction<GrGLUniform2ivProc> fUniform2iv; |
| 252 | GrGLFunction<GrGLUniform3fProc> fUniform3f; |
| 253 | GrGLFunction<GrGLUniform3iProc> fUniform3i; |
| 254 | GrGLFunction<GrGLUniform3fvProc> fUniform3fv; |
| 255 | GrGLFunction<GrGLUniform3ivProc> fUniform3iv; |
| 256 | GrGLFunction<GrGLUniform4fProc> fUniform4f; |
| 257 | GrGLFunction<GrGLUniform4iProc> fUniform4i; |
| 258 | GrGLFunction<GrGLUniform4fvProc> fUniform4fv; |
| 259 | GrGLFunction<GrGLUniform4ivProc> fUniform4iv; |
| 260 | GrGLFunction<GrGLUniformMatrix2fvProc> fUniformMatrix2fv; |
| 261 | GrGLFunction<GrGLUniformMatrix3fvProc> fUniformMatrix3fv; |
| 262 | GrGLFunction<GrGLUniformMatrix4fvProc> fUniformMatrix4fv; |
| 263 | GrGLFunction<GrGLUnmapBufferProc> fUnmapBuffer; |
| 264 | GrGLFunction<GrGLUnmapBufferSubDataProc> fUnmapBufferSubData; |
| 265 | GrGLFunction<GrGLUnmapTexSubImage2DProc> fUnmapTexSubImage2D; |
| 266 | GrGLFunction<GrGLUseProgramProc> fUseProgram; |
| 267 | GrGLFunction<GrGLVertexAttrib1fProc> fVertexAttrib1f; |
| 268 | GrGLFunction<GrGLVertexAttrib2fvProc> fVertexAttrib2fv; |
| 269 | GrGLFunction<GrGLVertexAttrib3fvProc> fVertexAttrib3fv; |
| 270 | GrGLFunction<GrGLVertexAttrib4fvProc> fVertexAttrib4fv; |
| 271 | GrGLFunction<GrGLVertexAttribDivisorProc> fVertexAttribDivisor; |
cdalton | 793dc26 | 2016-02-08 10:11:47 -0800 | [diff] [blame] | 272 | GrGLFunction<GrGLVertexAttribIPointerProc> fVertexAttribIPointer; |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 273 | GrGLFunction<GrGLVertexAttribPointerProc> fVertexAttribPointer; |
| 274 | GrGLFunction<GrGLViewportProc> fViewport; |
bsalomon@google.com | 271cffc | 2011-05-20 14:13:56 +0000 | [diff] [blame] | 275 | |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 276 | /* GL_NV_path_rendering */ |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 277 | GrGLFunction<GrGLMatrixLoadfProc> fMatrixLoadf; |
| 278 | GrGLFunction<GrGLMatrixLoadIdentityProc> fMatrixLoadIdentity; |
| 279 | GrGLFunction<GrGLGetProgramResourceLocationProc> fGetProgramResourceLocation; |
| 280 | GrGLFunction<GrGLPathCommandsProc> fPathCommands; |
| 281 | GrGLFunction<GrGLPathParameteriProc> fPathParameteri; |
| 282 | GrGLFunction<GrGLPathParameterfProc> fPathParameterf; |
| 283 | GrGLFunction<GrGLGenPathsProc> fGenPaths; |
| 284 | GrGLFunction<GrGLDeletePathsProc> fDeletePaths; |
| 285 | GrGLFunction<GrGLIsPathProc> fIsPath; |
| 286 | GrGLFunction<GrGLPathStencilFuncProc> fPathStencilFunc; |
| 287 | GrGLFunction<GrGLStencilFillPathProc> fStencilFillPath; |
| 288 | GrGLFunction<GrGLStencilStrokePathProc> fStencilStrokePath; |
| 289 | GrGLFunction<GrGLStencilFillPathInstancedProc> fStencilFillPathInstanced; |
| 290 | GrGLFunction<GrGLStencilStrokePathInstancedProc> fStencilStrokePathInstanced; |
| 291 | GrGLFunction<GrGLCoverFillPathProc> fCoverFillPath; |
| 292 | GrGLFunction<GrGLCoverStrokePathProc> fCoverStrokePath; |
| 293 | GrGLFunction<GrGLCoverFillPathInstancedProc> fCoverFillPathInstanced; |
| 294 | GrGLFunction<GrGLCoverStrokePathInstancedProc> fCoverStrokePathInstanced; |
cdalton | c7103a1 | 2014-08-11 14:05:05 -0700 | [diff] [blame] | 295 | // NV_path_rendering v1.2 |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 296 | GrGLFunction<GrGLStencilThenCoverFillPathProc> fStencilThenCoverFillPath; |
| 297 | GrGLFunction<GrGLStencilThenCoverStrokePathProc> fStencilThenCoverStrokePath; |
| 298 | GrGLFunction<GrGLStencilThenCoverFillPathInstancedProc> fStencilThenCoverFillPathInstanced; |
| 299 | GrGLFunction<GrGLStencilThenCoverStrokePathInstancedProc> fStencilThenCoverStrokePathInstanced; |
cdalton | c7103a1 | 2014-08-11 14:05:05 -0700 | [diff] [blame] | 300 | // NV_path_rendering v1.3 |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 301 | GrGLFunction<GrGLProgramPathFragmentInputGenProc> fProgramPathFragmentInputGen; |
kkinnunen | 6bb6d40 | 2015-07-14 10:59:23 -0700 | [diff] [blame] | 302 | // CHROMIUM_path_rendering |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 303 | GrGLFunction<GrGLBindFragmentInputLocationProc> fBindFragmentInputLocation; |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 304 | |
| 305 | /* NV_framebuffer_mixed_samples */ |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 306 | GrGLFunction<GrGLCoverageModulationProc> fCoverageModulation; |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 307 | |
ethannicholas | 28ef445 | 2016-03-25 09:26:03 -0700 | [diff] [blame] | 308 | /* ARB_sample_shading */ |
| 309 | GrGLFunction<GrGLMinSampleShadingProc> fMinSampleShading; |
| 310 | |
jvanverth | 84741b3 | 2016-09-30 08:39:02 -0700 | [diff] [blame] | 311 | /* ARB_sync */ |
| 312 | GrGLFunction<GrGLFenceSyncProc> fFenceSync; |
Greg Daniel | dba7e7c | 2017-07-20 15:47:30 -0400 | [diff] [blame] | 313 | GrGLFunction<GrGLIsSyncProc> fIsSync; |
jvanverth | 84741b3 | 2016-09-30 08:39:02 -0700 | [diff] [blame] | 314 | GrGLFunction<GrGLClientWaitSyncProc> fClientWaitSync; |
Greg Daniel | 6be3523 | 2017-03-01 17:01:09 -0500 | [diff] [blame] | 315 | GrGLFunction<GrGLWaitSyncProc> fWaitSync; |
jvanverth | 84741b3 | 2016-09-30 08:39:02 -0700 | [diff] [blame] | 316 | GrGLFunction<GrGLDeleteSyncProc> fDeleteSync; |
| 317 | |
Greg Daniel | 81e7bf8 | 2017-07-19 14:47:42 -0400 | [diff] [blame] | 318 | /* ARB_internalforamt_query */ |
| 319 | GrGLFunction<GrGLGetInternalformativProc> fGetInternalformativ; |
| 320 | |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 321 | /* KHR_debug */ |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 322 | GrGLFunction<GrGLDebugMessageControlProc> fDebugMessageControl; |
| 323 | GrGLFunction<GrGLDebugMessageInsertProc> fDebugMessageInsert; |
| 324 | GrGLFunction<GrGLDebugMessageCallbackProc> fDebugMessageCallback; |
| 325 | GrGLFunction<GrGLGetDebugMessageLogProc> fGetDebugMessageLog; |
| 326 | GrGLFunction<GrGLPushDebugGroupProc> fPushDebugGroup; |
| 327 | GrGLFunction<GrGLPopDebugGroupProc> fPopDebugGroup; |
| 328 | GrGLFunction<GrGLObjectLabelProc> fObjectLabel; |
bsalomon | b1a32ad | 2015-11-16 06:48:44 -0800 | [diff] [blame] | 329 | |
csmartdalton | 9bc1187 | 2016-08-09 12:42:47 -0700 | [diff] [blame] | 330 | /* EXT_window_rectangles */ |
| 331 | GrGLFunction<GrGLWindowRectanglesProc> fWindowRectangles; |
| 332 | |
bsalomon | b1a32ad | 2015-11-16 06:48:44 -0800 | [diff] [blame] | 333 | /* EGL functions */ |
bsalomon | 9f2dc27 | 2016-02-08 07:22:17 -0800 | [diff] [blame] | 334 | GrGLFunction<GrEGLCreateImageProc> fEGLCreateImage; |
| 335 | GrGLFunction<GrEGLDestroyImageProc> fEGLDestroyImage; |
commit-bot@chromium.org | c72425a | 2014-01-21 16:09:18 +0000 | [diff] [blame] | 336 | } fFunctions; |
| 337 | |
bsalomon | 944bcf0 | 2014-07-29 08:01:52 -0700 | [diff] [blame] | 338 | // This exists for internal testing. |
| 339 | virtual void abandon() const {} |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 340 | }; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 341 | |
| 342 | #endif |