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 { |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 82 | GrGLFunction<GrGLActiveTextureFn> fActiveTexture; |
| 83 | GrGLFunction<GrGLAttachShaderFn> fAttachShader; |
| 84 | GrGLFunction<GrGLBeginQueryFn> fBeginQuery; |
| 85 | GrGLFunction<GrGLBindAttribLocationFn> fBindAttribLocation; |
| 86 | GrGLFunction<GrGLBindBufferFn> fBindBuffer; |
| 87 | GrGLFunction<GrGLBindFragDataLocationFn> fBindFragDataLocation; |
| 88 | GrGLFunction<GrGLBindFragDataLocationIndexedFn> fBindFragDataLocationIndexed; |
| 89 | GrGLFunction<GrGLBindFramebufferFn> fBindFramebuffer; |
| 90 | GrGLFunction<GrGLBindRenderbufferFn> fBindRenderbuffer; |
Brian Salomon | a2a94a4 | 2018-10-16 10:54:10 -0400 | [diff] [blame] | 91 | GrGLFunction<GrGLBindSamplerFn> fBindSampler; |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 92 | GrGLFunction<GrGLBindTextureFn> fBindTexture; |
| 93 | GrGLFunction<GrGLBindVertexArrayFn> fBindVertexArray; |
| 94 | GrGLFunction<GrGLBlendBarrierFn> fBlendBarrier; |
| 95 | GrGLFunction<GrGLBlendColorFn> fBlendColor; |
| 96 | GrGLFunction<GrGLBlendEquationFn> fBlendEquation; |
| 97 | GrGLFunction<GrGLBlendFuncFn> fBlendFunc; |
| 98 | GrGLFunction<GrGLBlitFramebufferFn> fBlitFramebuffer; |
| 99 | GrGLFunction<GrGLBufferDataFn> fBufferData; |
| 100 | GrGLFunction<GrGLBufferSubDataFn> fBufferSubData; |
| 101 | GrGLFunction<GrGLCheckFramebufferStatusFn> fCheckFramebufferStatus; |
| 102 | GrGLFunction<GrGLClearFn> fClear; |
| 103 | GrGLFunction<GrGLClearColorFn> fClearColor; |
| 104 | GrGLFunction<GrGLClearStencilFn> fClearStencil; |
| 105 | GrGLFunction<GrGLClearTexImageFn> fClearTexImage; |
| 106 | GrGLFunction<GrGLClearTexSubImageFn> fClearTexSubImage; |
| 107 | GrGLFunction<GrGLColorMaskFn> fColorMask; |
| 108 | GrGLFunction<GrGLCompileShaderFn> fCompileShader; |
| 109 | GrGLFunction<GrGLCompressedTexImage2DFn> fCompressedTexImage2D; |
| 110 | GrGLFunction<GrGLCompressedTexSubImage2DFn> fCompressedTexSubImage2D; |
| 111 | GrGLFunction<GrGLCopyTexSubImage2DFn> fCopyTexSubImage2D; |
| 112 | GrGLFunction<GrGLCreateProgramFn> fCreateProgram; |
| 113 | GrGLFunction<GrGLCreateShaderFn> fCreateShader; |
| 114 | GrGLFunction<GrGLCullFaceFn> fCullFace; |
| 115 | GrGLFunction<GrGLDeleteBuffersFn> fDeleteBuffers; |
| 116 | GrGLFunction<GrGLDeleteFramebuffersFn> fDeleteFramebuffers; |
| 117 | GrGLFunction<GrGLDeleteProgramFn> fDeleteProgram; |
| 118 | GrGLFunction<GrGLDeleteQueriesFn> fDeleteQueries; |
| 119 | GrGLFunction<GrGLDeleteRenderbuffersFn> fDeleteRenderbuffers; |
Brian Salomon | a2a94a4 | 2018-10-16 10:54:10 -0400 | [diff] [blame] | 120 | GrGLFunction<GrGLDeleteSamplersFn> fDeleteSamplers; |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 121 | GrGLFunction<GrGLDeleteShaderFn> fDeleteShader; |
| 122 | GrGLFunction<GrGLDeleteTexturesFn> fDeleteTextures; |
| 123 | GrGLFunction<GrGLDeleteVertexArraysFn> fDeleteVertexArrays; |
| 124 | GrGLFunction<GrGLDepthMaskFn> fDepthMask; |
| 125 | GrGLFunction<GrGLDisableFn> fDisable; |
| 126 | GrGLFunction<GrGLDisableVertexAttribArrayFn> fDisableVertexAttribArray; |
| 127 | GrGLFunction<GrGLDrawArraysFn> fDrawArrays; |
| 128 | GrGLFunction<GrGLDrawArraysIndirectFn> fDrawArraysIndirect; |
| 129 | GrGLFunction<GrGLDrawArraysInstancedFn> fDrawArraysInstanced; |
| 130 | GrGLFunction<GrGLDrawBufferFn> fDrawBuffer; |
| 131 | GrGLFunction<GrGLDrawBuffersFn> fDrawBuffers; |
| 132 | GrGLFunction<GrGLDrawElementsFn> fDrawElements; |
| 133 | GrGLFunction<GrGLDrawElementsIndirectFn> fDrawElementsIndirect; |
| 134 | GrGLFunction<GrGLDrawElementsInstancedFn> fDrawElementsInstanced; |
| 135 | GrGLFunction<GrGLDrawRangeElementsFn> fDrawRangeElements; |
| 136 | GrGLFunction<GrGLEnableFn> fEnable; |
| 137 | GrGLFunction<GrGLEnableVertexAttribArrayFn> fEnableVertexAttribArray; |
| 138 | GrGLFunction<GrGLEndQueryFn> fEndQuery; |
| 139 | GrGLFunction<GrGLFinishFn> fFinish; |
| 140 | GrGLFunction<GrGLFlushFn> fFlush; |
| 141 | GrGLFunction<GrGLFlushMappedBufferRangeFn> fFlushMappedBufferRange; |
| 142 | GrGLFunction<GrGLFramebufferRenderbufferFn> fFramebufferRenderbuffer; |
| 143 | GrGLFunction<GrGLFramebufferTexture2DFn> fFramebufferTexture2D; |
| 144 | GrGLFunction<GrGLFramebufferTexture2DMultisampleFn> fFramebufferTexture2DMultisample; |
| 145 | GrGLFunction<GrGLFrontFaceFn> fFrontFace; |
| 146 | GrGLFunction<GrGLGenBuffersFn> fGenBuffers; |
| 147 | GrGLFunction<GrGLGenFramebuffersFn> fGenFramebuffers; |
| 148 | GrGLFunction<GrGLGenerateMipmapFn> fGenerateMipmap; |
| 149 | GrGLFunction<GrGLGenQueriesFn> fGenQueries; |
| 150 | GrGLFunction<GrGLGenRenderbuffersFn> fGenRenderbuffers; |
Brian Salomon | a2a94a4 | 2018-10-16 10:54:10 -0400 | [diff] [blame] | 151 | GrGLFunction<GrGLGenSamplersFn> fGenSamplers; |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 152 | GrGLFunction<GrGLGenTexturesFn> fGenTextures; |
| 153 | GrGLFunction<GrGLGenVertexArraysFn> fGenVertexArrays; |
| 154 | GrGLFunction<GrGLGetBufferParameterivFn> fGetBufferParameteriv; |
| 155 | GrGLFunction<GrGLGetErrorFn> fGetError; |
| 156 | GrGLFunction<GrGLGetFramebufferAttachmentParameterivFn> fGetFramebufferAttachmentParameteriv; |
| 157 | GrGLFunction<GrGLGetIntegervFn> fGetIntegerv; |
| 158 | GrGLFunction<GrGLGetMultisamplefvFn> fGetMultisamplefv; |
| 159 | GrGLFunction<GrGLGetProgramBinaryFn> fGetProgramBinary; |
| 160 | GrGLFunction<GrGLGetProgramInfoLogFn> fGetProgramInfoLog; |
| 161 | GrGLFunction<GrGLGetProgramivFn> fGetProgramiv; |
| 162 | GrGLFunction<GrGLGetQueryObjecti64vFn> fGetQueryObjecti64v; |
| 163 | GrGLFunction<GrGLGetQueryObjectivFn> fGetQueryObjectiv; |
| 164 | GrGLFunction<GrGLGetQueryObjectui64vFn> fGetQueryObjectui64v; |
| 165 | GrGLFunction<GrGLGetQueryObjectuivFn> fGetQueryObjectuiv; |
| 166 | GrGLFunction<GrGLGetQueryivFn> fGetQueryiv; |
| 167 | GrGLFunction<GrGLGetRenderbufferParameterivFn> fGetRenderbufferParameteriv; |
| 168 | GrGLFunction<GrGLGetShaderInfoLogFn> fGetShaderInfoLog; |
| 169 | GrGLFunction<GrGLGetShaderivFn> fGetShaderiv; |
| 170 | GrGLFunction<GrGLGetShaderPrecisionFormatFn> fGetShaderPrecisionFormat; |
| 171 | GrGLFunction<GrGLGetStringFn> fGetString; |
| 172 | GrGLFunction<GrGLGetStringiFn> fGetStringi; |
| 173 | GrGLFunction<GrGLGetTexLevelParameterivFn> fGetTexLevelParameteriv; |
| 174 | GrGLFunction<GrGLGetUniformLocationFn> fGetUniformLocation; |
| 175 | GrGLFunction<GrGLInsertEventMarkerFn> fInsertEventMarker; |
| 176 | GrGLFunction<GrGLInvalidateBufferDataFn> fInvalidateBufferData; |
| 177 | GrGLFunction<GrGLInvalidateBufferSubDataFn> fInvalidateBufferSubData; |
| 178 | GrGLFunction<GrGLInvalidateFramebufferFn> fInvalidateFramebuffer; |
| 179 | GrGLFunction<GrGLInvalidateSubFramebufferFn> fInvalidateSubFramebuffer; |
| 180 | GrGLFunction<GrGLInvalidateTexImageFn> fInvalidateTexImage; |
| 181 | GrGLFunction<GrGLInvalidateTexSubImageFn> fInvalidateTexSubImage; |
| 182 | GrGLFunction<GrGLIsTextureFn> fIsTexture; |
| 183 | GrGLFunction<GrGLLineWidthFn> fLineWidth; |
| 184 | GrGLFunction<GrGLLinkProgramFn> fLinkProgram; |
| 185 | GrGLFunction<GrGLProgramBinaryFn> fProgramBinary; |
| 186 | GrGLFunction<GrGLProgramParameteriFn> fProgramParameteri; |
| 187 | GrGLFunction<GrGLMapBufferFn> fMapBuffer; |
| 188 | GrGLFunction<GrGLMapBufferRangeFn> fMapBufferRange; |
| 189 | GrGLFunction<GrGLMapBufferSubDataFn> fMapBufferSubData; |
| 190 | GrGLFunction<GrGLMapTexSubImage2DFn> fMapTexSubImage2D; |
| 191 | GrGLFunction<GrGLMultiDrawArraysIndirectFn> fMultiDrawArraysIndirect; |
| 192 | GrGLFunction<GrGLMultiDrawElementsIndirectFn> fMultiDrawElementsIndirect; |
| 193 | GrGLFunction<GrGLPixelStoreiFn> fPixelStorei; |
| 194 | GrGLFunction<GrGLPolygonModeFn> fPolygonMode; |
| 195 | GrGLFunction<GrGLPopGroupMarkerFn> fPopGroupMarker; |
| 196 | GrGLFunction<GrGLPushGroupMarkerFn> fPushGroupMarker; |
| 197 | GrGLFunction<GrGLQueryCounterFn> fQueryCounter; |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 198 | GrGLFunction<GrGLReadBufferFn> fReadBuffer; |
| 199 | GrGLFunction<GrGLReadPixelsFn> fReadPixels; |
| 200 | GrGLFunction<GrGLRenderbufferStorageFn> fRenderbufferStorage; |
commit-bot@chromium.org | a8e5a06 | 2013-09-05 23:44:09 +0000 | [diff] [blame] | 201 | |
commit-bot@chromium.org | c72425a | 2014-01-21 16:09:18 +0000 | [diff] [blame] | 202 | // On OpenGL ES there are multiple incompatible extensions that add support for MSAA |
| 203 | // and ES3 adds MSAA support to the standard. On an ES3 driver we may still use the |
| 204 | // older extensions for performance reasons or due to ES3 driver bugs. We want the function |
| 205 | // that creates the GrGLInterface to provide all available functions and internally |
| 206 | // we will select among them. They all have a method called glRenderbufferStorageMultisample*. |
| 207 | // So we have separate function pointers for GL_IMG/EXT_multisampled_to_texture, |
| 208 | // GL_CHROMIUM/ANGLE_framebuffer_multisample/ES3, and GL_APPLE_framebuffer_multisample |
| 209 | // variations. |
| 210 | // |
| 211 | // If a driver supports multiple GL_ARB_framebuffer_multisample-style extensions then we will |
| 212 | // assume the function pointers for the standard (or equivalent GL_ARB) version have |
| 213 | // been preferred over GL_EXT, GL_CHROMIUM, or GL_ANGLE variations that have reduced |
| 214 | // functionality. |
commit-bot@chromium.org | a8e5a06 | 2013-09-05 23:44:09 +0000 | [diff] [blame] | 215 | |
commit-bot@chromium.org | c72425a | 2014-01-21 16:09:18 +0000 | [diff] [blame] | 216 | // GL_EXT_multisampled_render_to_texture (preferred) or GL_IMG_multisampled_render_to_texture |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 217 | GrGLFunction<GrGLRenderbufferStorageMultisampleFn> fRenderbufferStorageMultisampleES2EXT; |
commit-bot@chromium.org | c72425a | 2014-01-21 16:09:18 +0000 | [diff] [blame] | 218 | // GL_APPLE_framebuffer_multisample |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 219 | GrGLFunction<GrGLRenderbufferStorageMultisampleFn> fRenderbufferStorageMultisampleES2APPLE; |
commit-bot@chromium.org | 92b7884 | 2014-01-16 20:49:46 +0000 | [diff] [blame] | 220 | |
commit-bot@chromium.org | c72425a | 2014-01-21 16:09:18 +0000 | [diff] [blame] | 221 | // This is used to store the pointer for GL_ARB/EXT/ANGLE/CHROMIUM_framebuffer_multisample or |
| 222 | // the standard function in ES3+ or GL 3.0+. |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 223 | GrGLFunction<GrGLRenderbufferStorageMultisampleFn> fRenderbufferStorageMultisample; |
commit-bot@chromium.org | a8e5a06 | 2013-09-05 23:44:09 +0000 | [diff] [blame] | 224 | |
commit-bot@chromium.org | c72425a | 2014-01-21 16:09:18 +0000 | [diff] [blame] | 225 | // Pointer to BindUniformLocationCHROMIUM from the GL_CHROMIUM_bind_uniform_location extension. |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 226 | GrGLFunction<GrGLBindUniformLocationFn> fBindUniformLocation; |
commit-bot@chromium.org | d3baf20 | 2013-11-07 22:06:08 +0000 | [diff] [blame] | 227 | |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 228 | GrGLFunction<GrGLResolveMultisampleFramebufferFn> fResolveMultisampleFramebuffer; |
Brian Salomon | a2a94a4 | 2018-10-16 10:54:10 -0400 | [diff] [blame] | 229 | GrGLFunction<GrGLSamplerParameteriFn> fSamplerParameteri; |
| 230 | GrGLFunction<GrGLSamplerParameterivFn> fSamplerParameteriv; |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 231 | GrGLFunction<GrGLScissorFn> fScissor; |
| 232 | GrGLFunction<GrGLShaderSourceFn> fShaderSource; |
| 233 | GrGLFunction<GrGLStencilFuncFn> fStencilFunc; |
| 234 | GrGLFunction<GrGLStencilFuncSeparateFn> fStencilFuncSeparate; |
| 235 | GrGLFunction<GrGLStencilMaskFn> fStencilMask; |
| 236 | GrGLFunction<GrGLStencilMaskSeparateFn> fStencilMaskSeparate; |
| 237 | GrGLFunction<GrGLStencilOpFn> fStencilOp; |
| 238 | GrGLFunction<GrGLStencilOpSeparateFn> fStencilOpSeparate; |
| 239 | GrGLFunction<GrGLTexBufferFn> fTexBuffer; |
| 240 | GrGLFunction<GrGLTexBufferRangeFn> fTexBufferRange; |
| 241 | GrGLFunction<GrGLTexImage2DFn> fTexImage2D; |
Brian Salomon | 0a7e58f | 2018-12-07 19:20:19 -0500 | [diff] [blame] | 242 | GrGLFunction<GrGLTexParameterfFn> fTexParameterf; |
| 243 | GrGLFunction<GrGLTexParameterfvFn> fTexParameterfv; |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 244 | GrGLFunction<GrGLTexParameteriFn> fTexParameteri; |
| 245 | GrGLFunction<GrGLTexParameterivFn> fTexParameteriv; |
| 246 | GrGLFunction<GrGLTexSubImage2DFn> fTexSubImage2D; |
| 247 | GrGLFunction<GrGLTexStorage2DFn> fTexStorage2D; |
| 248 | GrGLFunction<GrGLTextureBarrierFn> fTextureBarrier; |
| 249 | GrGLFunction<GrGLDiscardFramebufferFn> fDiscardFramebuffer; |
| 250 | GrGLFunction<GrGLUniform1fFn> fUniform1f; |
| 251 | GrGLFunction<GrGLUniform1iFn> fUniform1i; |
| 252 | GrGLFunction<GrGLUniform1fvFn> fUniform1fv; |
| 253 | GrGLFunction<GrGLUniform1ivFn> fUniform1iv; |
| 254 | GrGLFunction<GrGLUniform2fFn> fUniform2f; |
| 255 | GrGLFunction<GrGLUniform2iFn> fUniform2i; |
| 256 | GrGLFunction<GrGLUniform2fvFn> fUniform2fv; |
| 257 | GrGLFunction<GrGLUniform2ivFn> fUniform2iv; |
| 258 | GrGLFunction<GrGLUniform3fFn> fUniform3f; |
| 259 | GrGLFunction<GrGLUniform3iFn> fUniform3i; |
| 260 | GrGLFunction<GrGLUniform3fvFn> fUniform3fv; |
| 261 | GrGLFunction<GrGLUniform3ivFn> fUniform3iv; |
| 262 | GrGLFunction<GrGLUniform4fFn> fUniform4f; |
| 263 | GrGLFunction<GrGLUniform4iFn> fUniform4i; |
| 264 | GrGLFunction<GrGLUniform4fvFn> fUniform4fv; |
| 265 | GrGLFunction<GrGLUniform4ivFn> fUniform4iv; |
| 266 | GrGLFunction<GrGLUniformMatrix2fvFn> fUniformMatrix2fv; |
| 267 | GrGLFunction<GrGLUniformMatrix3fvFn> fUniformMatrix3fv; |
| 268 | GrGLFunction<GrGLUniformMatrix4fvFn> fUniformMatrix4fv; |
| 269 | GrGLFunction<GrGLUnmapBufferFn> fUnmapBuffer; |
| 270 | GrGLFunction<GrGLUnmapBufferSubDataFn> fUnmapBufferSubData; |
| 271 | GrGLFunction<GrGLUnmapTexSubImage2DFn> fUnmapTexSubImage2D; |
| 272 | GrGLFunction<GrGLUseProgramFn> fUseProgram; |
| 273 | GrGLFunction<GrGLVertexAttrib1fFn> fVertexAttrib1f; |
| 274 | GrGLFunction<GrGLVertexAttrib2fvFn> fVertexAttrib2fv; |
| 275 | GrGLFunction<GrGLVertexAttrib3fvFn> fVertexAttrib3fv; |
| 276 | GrGLFunction<GrGLVertexAttrib4fvFn> fVertexAttrib4fv; |
| 277 | GrGLFunction<GrGLVertexAttribDivisorFn> fVertexAttribDivisor; |
| 278 | GrGLFunction<GrGLVertexAttribIPointerFn> fVertexAttribIPointer; |
| 279 | GrGLFunction<GrGLVertexAttribPointerFn> fVertexAttribPointer; |
| 280 | GrGLFunction<GrGLViewportFn> fViewport; |
bsalomon@google.com | 271cffc | 2011-05-20 14:13:56 +0000 | [diff] [blame] | 281 | |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 282 | /* GL_NV_path_rendering */ |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 283 | GrGLFunction<GrGLMatrixLoadfFn> fMatrixLoadf; |
| 284 | GrGLFunction<GrGLMatrixLoadIdentityFn> fMatrixLoadIdentity; |
| 285 | GrGLFunction<GrGLGetProgramResourceLocationFn> fGetProgramResourceLocation; |
| 286 | GrGLFunction<GrGLPathCommandsFn> fPathCommands; |
| 287 | GrGLFunction<GrGLPathParameteriFn> fPathParameteri; |
| 288 | GrGLFunction<GrGLPathParameterfFn> fPathParameterf; |
| 289 | GrGLFunction<GrGLGenPathsFn> fGenPaths; |
| 290 | GrGLFunction<GrGLDeletePathsFn> fDeletePaths; |
| 291 | GrGLFunction<GrGLIsPathFn> fIsPath; |
| 292 | GrGLFunction<GrGLPathStencilFuncFn> fPathStencilFunc; |
| 293 | GrGLFunction<GrGLStencilFillPathFn> fStencilFillPath; |
| 294 | GrGLFunction<GrGLStencilStrokePathFn> fStencilStrokePath; |
| 295 | GrGLFunction<GrGLStencilFillPathInstancedFn> fStencilFillPathInstanced; |
| 296 | GrGLFunction<GrGLStencilStrokePathInstancedFn> fStencilStrokePathInstanced; |
| 297 | GrGLFunction<GrGLCoverFillPathFn> fCoverFillPath; |
| 298 | GrGLFunction<GrGLCoverStrokePathFn> fCoverStrokePath; |
| 299 | GrGLFunction<GrGLCoverFillPathInstancedFn> fCoverFillPathInstanced; |
| 300 | GrGLFunction<GrGLCoverStrokePathInstancedFn> fCoverStrokePathInstanced; |
cdalton | c7103a1 | 2014-08-11 14:05:05 -0700 | [diff] [blame] | 301 | // NV_path_rendering v1.2 |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 302 | GrGLFunction<GrGLStencilThenCoverFillPathFn> fStencilThenCoverFillPath; |
| 303 | GrGLFunction<GrGLStencilThenCoverStrokePathFn> fStencilThenCoverStrokePath; |
| 304 | GrGLFunction<GrGLStencilThenCoverFillPathInstancedFn> fStencilThenCoverFillPathInstanced; |
| 305 | GrGLFunction<GrGLStencilThenCoverStrokePathInstancedFn> fStencilThenCoverStrokePathInstanced; |
cdalton | c7103a1 | 2014-08-11 14:05:05 -0700 | [diff] [blame] | 306 | // NV_path_rendering v1.3 |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 307 | GrGLFunction<GrGLProgramPathFragmentInputGenFn> fProgramPathFragmentInputGen; |
kkinnunen | 6bb6d40 | 2015-07-14 10:59:23 -0700 | [diff] [blame] | 308 | // CHROMIUM_path_rendering |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 309 | GrGLFunction<GrGLBindFragmentInputLocationFn> fBindFragmentInputLocation; |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 310 | |
| 311 | /* NV_framebuffer_mixed_samples */ |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 312 | GrGLFunction<GrGLCoverageModulationFn> fCoverageModulation; |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 313 | |
jvanverth | 84741b3 | 2016-09-30 08:39:02 -0700 | [diff] [blame] | 314 | /* ARB_sync */ |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 315 | GrGLFunction<GrGLFenceSyncFn> fFenceSync; |
| 316 | GrGLFunction<GrGLIsSyncFn> fIsSync; |
| 317 | GrGLFunction<GrGLClientWaitSyncFn> fClientWaitSync; |
| 318 | GrGLFunction<GrGLWaitSyncFn> fWaitSync; |
| 319 | GrGLFunction<GrGLDeleteSyncFn> fDeleteSync; |
jvanverth | 84741b3 | 2016-09-30 08:39:02 -0700 | [diff] [blame] | 320 | |
Greg Daniel | 81e7bf8 | 2017-07-19 14:47:42 -0400 | [diff] [blame] | 321 | /* ARB_internalforamt_query */ |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 322 | GrGLFunction<GrGLGetInternalformativFn> fGetInternalformativ; |
Greg Daniel | 81e7bf8 | 2017-07-19 14:47:42 -0400 | [diff] [blame] | 323 | |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 324 | /* KHR_debug */ |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 325 | GrGLFunction<GrGLDebugMessageControlFn> fDebugMessageControl; |
| 326 | GrGLFunction<GrGLDebugMessageInsertFn> fDebugMessageInsert; |
| 327 | GrGLFunction<GrGLDebugMessageCallbackFn> fDebugMessageCallback; |
| 328 | GrGLFunction<GrGLGetDebugMessageLogFn> fGetDebugMessageLog; |
| 329 | GrGLFunction<GrGLPushDebugGroupFn> fPushDebugGroup; |
| 330 | GrGLFunction<GrGLPopDebugGroupFn> fPopDebugGroup; |
| 331 | GrGLFunction<GrGLObjectLabelFn> fObjectLabel; |
bsalomon | b1a32ad | 2015-11-16 06:48:44 -0800 | [diff] [blame] | 332 | |
csmartdalton | 9bc1187 | 2016-08-09 12:42:47 -0700 | [diff] [blame] | 333 | /* EXT_window_rectangles */ |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 334 | GrGLFunction<GrGLWindowRectanglesFn> fWindowRectangles; |
csmartdalton | 9bc1187 | 2016-08-09 12:42:47 -0700 | [diff] [blame] | 335 | |
bsalomon | b1a32ad | 2015-11-16 06:48:44 -0800 | [diff] [blame] | 336 | /* EGL functions */ |
Brian Salomon | 2424ec4 | 2018-08-24 10:26:42 -0400 | [diff] [blame] | 337 | GrGLFunction<GrEGLCreateImageFn> fEGLCreateImage; |
| 338 | GrGLFunction<GrEGLDestroyImageFn> fEGLDestroyImage; |
commit-bot@chromium.org | c72425a | 2014-01-21 16:09:18 +0000 | [diff] [blame] | 339 | } fFunctions; |
| 340 | |
Robert Phillips | 752e08b | 2018-06-22 09:48:38 -0400 | [diff] [blame] | 341 | #if GR_TEST_UTILS |
bsalomon | 944bcf0 | 2014-07-29 08:01:52 -0700 | [diff] [blame] | 342 | // This exists for internal testing. |
Robert Phillips | 752e08b | 2018-06-22 09:48:38 -0400 | [diff] [blame] | 343 | virtual void abandon() const; |
| 344 | #endif |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 345 | }; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 346 | |
| 347 | #endif |