| 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 | a4de8c2 | 2013-09-09 13:38:37 +0000 | [diff] [blame] | 12 | #include "SkRefCnt.h" | 
| twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 13 |  | 
| twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 14 | //////////////////////////////////////////////////////////////////////////////// | 
|  | 15 |  | 
|  | 16 | /** | 
| commit-bot@chromium.org | 9e90aed | 2014-01-16 16:35:09 +0000 | [diff] [blame] | 17 | * Classifies GL contexts by which standard they implement (currently as Desktop | 
|  | 18 | * vs. ES). | 
| bsalomon@google.com | 89ec61e | 2012-02-10 20:05:18 +0000 | [diff] [blame] | 19 | */ | 
| commit-bot@chromium.org | 9e90aed | 2014-01-16 16:35:09 +0000 | [diff] [blame] | 20 | enum GrGLStandard { | 
|  | 21 | kNone_GrGLStandard, | 
|  | 22 | kGL_GrGLStandard, | 
|  | 23 | kGLES_GrGLStandard, | 
| bsalomon@google.com | 89ec61e | 2012-02-10 20:05:18 +0000 | [diff] [blame] | 24 | }; | 
|  | 25 |  | 
| commit-bot@chromium.org | cc190eb | 2014-01-16 18:49:01 +0000 | [diff] [blame] | 26 | // Temporary aliases until Chromium can be updated. | 
|  | 27 | typedef GrGLStandard GrGLBinding; | 
| commit-bot@chromium.org | 9e90aed | 2014-01-16 16:35:09 +0000 | [diff] [blame] | 28 | static const GrGLStandard kES2_GrGLBinding = kGLES_GrGLStandard; | 
| commit-bot@chromium.org | cc190eb | 2014-01-16 18:49:01 +0000 | [diff] [blame] | 29 | static const GrGLStandard kDesktop_GrGLBinding = kGL_GrGLStandard; | 
| bsalomon@google.com | 46b450a | 2013-08-15 19:45:26 +0000 | [diff] [blame] | 30 |  | 
| bsalomon@google.com | 89ec61e | 2012-02-10 20:05:18 +0000 | [diff] [blame] | 31 | //////////////////////////////////////////////////////////////////////////////// | 
|  | 32 |  | 
|  | 33 | /** | 
| bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 34 | * Rather than depend on platform-specific GL headers and libraries, we require | 
|  | 35 | * the client to provide a struct of GL function pointers. This struct can be | 
|  | 36 | * specified per-GrContext as a parameter to GrContext::Create. If NULL is | 
| commit-bot@chromium.org | a3b15ed | 2014-01-15 19:32:03 +0000 | [diff] [blame] | 37 | * passed to Create then a "default" GL interface is created. If the default is | 
| bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 38 | * also NULL GrContext creation will fail. | 
|  | 39 | * | 
| bsalomon@google.com | 6fb736f | 2011-09-16 18:51:57 +0000 | [diff] [blame] | 40 | * The default interface is returned by GrGLDefaultInterface. This function's | 
| robertphillips@google.com | 0da3719 | 2012-03-19 14:42:13 +0000 | [diff] [blame] | 41 | * implementation is platform-specific. Several have been provided, along with | 
| commit-bot@chromium.org | a3b15ed | 2014-01-15 19:32:03 +0000 | [diff] [blame] | 42 | * an implementation that simply returns NULL. | 
| bsalomon@google.com | 56bfc5a | 2011-09-01 13:28:16 +0000 | [diff] [blame] | 43 | * | 
|  | 44 | * By defining GR_GL_PER_GL_CALL_IFACE_CALLBACK to 1 the client can specify a | 
|  | 45 | * callback function that will be called prior to each GL function call. See | 
|  | 46 | * comments in GrGLConfig.h | 
| twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 47 | */ | 
| twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 48 |  | 
| bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 49 | struct GrGLInterface; | 
|  | 50 |  | 
| bsalomon@google.com | 6fb736f | 2011-09-16 18:51:57 +0000 | [diff] [blame] | 51 | const GrGLInterface* GrGLDefaultInterface(); | 
| twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 52 |  | 
| bsalomon@google.com | 57f5d98 | 2011-10-24 21:17:53 +0000 | [diff] [blame] | 53 | /** | 
|  | 54 | * Creates a GrGLInterface for a "native" GL context (e.g. WGL on windows, | 
| commit-bot@chromium.org | a3b15ed | 2014-01-15 19:32:03 +0000 | [diff] [blame] | 55 | * GLX on linux, AGL on Mac). The interface is only valid for the GL context | 
|  | 56 | * that is current when the interface is created. | 
| bsalomon@google.com | 57f5d98 | 2011-10-24 21:17:53 +0000 | [diff] [blame] | 57 | */ | 
| bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 58 | const GrGLInterface* GrGLCreateNativeInterface(); | 
|  | 59 |  | 
| robertphillips@google.com | d3b9fbb | 2012-03-28 16:19:11 +0000 | [diff] [blame] | 60 | #if SK_MESA | 
| bsalomon@google.com | 57f5d98 | 2011-10-24 21:17:53 +0000 | [diff] [blame] | 61 | /** | 
|  | 62 | * Creates a GrGLInterface for an OSMesa context. | 
|  | 63 | */ | 
| bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 64 | const GrGLInterface* GrGLCreateMesaInterface(); | 
| robertphillips@google.com | d3b9fbb | 2012-03-28 16:19:11 +0000 | [diff] [blame] | 65 | #endif | 
|  | 66 |  | 
|  | 67 | #if SK_ANGLE | 
|  | 68 | /** | 
|  | 69 | * Creates a GrGLInterface for an ANGLE context. | 
|  | 70 | */ | 
|  | 71 | const GrGLInterface* GrGLCreateANGLEInterface(); | 
|  | 72 | #endif | 
| bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 73 |  | 
| bsalomon@google.com | 7491372 | 2011-10-27 20:44:19 +0000 | [diff] [blame] | 74 | /** | 
|  | 75 | * Creates a null GrGLInterface that doesn't draw anything. Used for measuring | 
|  | 76 | * CPU overhead. | 
|  | 77 | */ | 
| commit-bot@chromium.org | aae7c2a | 2013-11-25 20:39:27 +0000 | [diff] [blame] | 78 | const SK_API GrGLInterface* GrGLCreateNullInterface(); | 
| bsalomon@google.com | 7491372 | 2011-10-27 20:44:19 +0000 | [diff] [blame] | 79 |  | 
| robertphillips@google.com | 0da3719 | 2012-03-19 14:42:13 +0000 | [diff] [blame] | 80 | /** | 
| rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 81 | * Creates a debugging GrGLInterface that doesn't draw anything. Used for | 
| robertphillips@google.com | 0da3719 | 2012-03-19 14:42:13 +0000 | [diff] [blame] | 82 | * finding memory leaks and invalid memory accesses. | 
|  | 83 | */ | 
|  | 84 | const GrGLInterface* GrGLCreateDebugInterface(); | 
|  | 85 |  | 
| bsalomon@google.com | 56bfc5a | 2011-09-01 13:28:16 +0000 | [diff] [blame] | 86 | #if GR_GL_PER_GL_FUNC_CALLBACK | 
|  | 87 | typedef void (*GrGLInterfaceCallbackProc)(const GrGLInterface*); | 
|  | 88 | typedef intptr_t GrGLInterfaceCallbackData; | 
|  | 89 | #endif | 
|  | 90 |  | 
| bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 91 | /* | 
| bsalomon@google.com | cc61b17 | 2012-05-07 21:45:48 +0000 | [diff] [blame] | 92 | * GrContext uses the following interface to make all calls into OpenGL. When a | 
|  | 93 | * GrContext is created it is given a GrGLInterface. The interface's function | 
|  | 94 | * pointers must be valid for the OpenGL context associated with the GrContext. | 
|  | 95 | * On some platforms, such as Windows, function pointers for OpenGL extensions | 
|  | 96 | * may vary between OpenGL contexts. So the caller must be careful to use a | 
|  | 97 | * GrGLInterface initialized for the correct context. All functions that should | 
|  | 98 | * be available based on the OpenGL's version and extension string must be | 
|  | 99 | * non-NULL or GrContext creation will fail. This can be tested with the | 
|  | 100 | * validate() method when the OpenGL context has been made current. | 
| bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 101 | */ | 
| commit-bot@chromium.org | a4de8c2 | 2013-09-09 13:38:37 +0000 | [diff] [blame] | 102 | struct SK_API GrGLInterface : public SkRefCnt { | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 103 | private: | 
| bsalomon@google.com | 9c1f1ac | 2012-05-07 17:09:37 +0000 | [diff] [blame] | 104 | // simple wrapper class that exists only to initialize a pointer to NULL | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 105 | template <typename FNPTR_TYPE> class GLPtr { | 
|  | 106 | public: | 
|  | 107 | GLPtr() : fPtr(NULL) {} | 
|  | 108 | GLPtr operator =(FNPTR_TYPE ptr) { fPtr = ptr; return *this; } | 
|  | 109 | operator FNPTR_TYPE() const { return fPtr; } | 
|  | 110 | private: | 
|  | 111 | FNPTR_TYPE fPtr; | 
|  | 112 | }; | 
| bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 113 |  | 
| commit-bot@chromium.org | a4de8c2 | 2013-09-09 13:38:37 +0000 | [diff] [blame] | 114 | typedef SkRefCnt INHERITED; | 
| robertphillips@google.com | 15e9d3e | 2012-06-21 20:25:03 +0000 | [diff] [blame] | 115 |  | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 116 | public: | 
| robertphillips@google.com | 15e9d3e | 2012-06-21 20:25:03 +0000 | [diff] [blame] | 117 | SK_DECLARE_INST_COUNT(GrGLInterface) | 
|  | 118 |  | 
| bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 119 | GrGLInterface(); | 
|  | 120 |  | 
| commit-bot@chromium.org | 9e90aed | 2014-01-16 16:35:09 +0000 | [diff] [blame] | 121 | // Validates that the GrGLInterface supports its advertised standard. This means the necessary | 
|  | 122 | // function pointers have been initialized for both the GL version and any advertised | 
|  | 123 | // extensions. | 
|  | 124 | bool validate() const; | 
| bsalomon@google.com | 89ec61e | 2012-02-10 20:05:18 +0000 | [diff] [blame] | 125 |  | 
| commit-bot@chromium.org | 9e90aed | 2014-01-16 16:35:09 +0000 | [diff] [blame] | 126 | // Indicates the type of GL implementation | 
|  | 127 | union { | 
|  | 128 | GrGLStandard fStandard; | 
|  | 129 | GrGLStandard fBindingsExported; // Legacy name, will be remove when Chromium is updated. | 
|  | 130 | }; | 
| twiz@google.com | b65e0cb | 2011-03-18 20:41:44 +0000 | [diff] [blame] | 131 |  | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 132 | GLPtr<GrGLActiveTextureProc> fActiveTexture; | 
|  | 133 | GLPtr<GrGLAttachShaderProc> fAttachShader; | 
|  | 134 | GLPtr<GrGLBeginQueryProc> fBeginQuery; | 
|  | 135 | GLPtr<GrGLBindAttribLocationProc> fBindAttribLocation; | 
|  | 136 | GLPtr<GrGLBindBufferProc> fBindBuffer; | 
|  | 137 | GLPtr<GrGLBindFragDataLocationProc> fBindFragDataLocation; | 
|  | 138 | GLPtr<GrGLBindFragDataLocationIndexedProc> fBindFragDataLocationIndexed; | 
|  | 139 | GLPtr<GrGLBindFramebufferProc> fBindFramebuffer; | 
|  | 140 | GLPtr<GrGLBindRenderbufferProc> fBindRenderbuffer; | 
|  | 141 | GLPtr<GrGLBindTextureProc> fBindTexture; | 
| bsalomon@google.com | ecd8484 | 2013-03-01 15:36:02 +0000 | [diff] [blame] | 142 | GLPtr<GrGLBindVertexArrayProc> fBindVertexArray; | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 143 | GLPtr<GrGLBlendColorProc> fBlendColor; | 
|  | 144 | GLPtr<GrGLBlendFuncProc> fBlendFunc; | 
|  | 145 | GLPtr<GrGLBlitFramebufferProc> fBlitFramebuffer; | 
|  | 146 | GLPtr<GrGLBufferDataProc> fBufferData; | 
|  | 147 | GLPtr<GrGLBufferSubDataProc> fBufferSubData; | 
|  | 148 | GLPtr<GrGLCheckFramebufferStatusProc> fCheckFramebufferStatus; | 
|  | 149 | GLPtr<GrGLClearProc> fClear; | 
|  | 150 | GLPtr<GrGLClearColorProc> fClearColor; | 
|  | 151 | GLPtr<GrGLClearStencilProc> fClearStencil; | 
| commit-bot@chromium.org | 46fbfe0 | 2013-08-30 15:52:12 +0000 | [diff] [blame] | 152 | GLPtr<GrGLClientActiveTextureProc> fClientActiveTexture; | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 153 | GLPtr<GrGLColorMaskProc> fColorMask; | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 154 | GLPtr<GrGLCompileShaderProc> fCompileShader; | 
|  | 155 | GLPtr<GrGLCompressedTexImage2DProc> fCompressedTexImage2D; | 
| commit-bot@chromium.org | 98168bb | 2013-04-11 22:00:34 +0000 | [diff] [blame] | 156 | GLPtr<GrGLCopyTexSubImage2DProc> fCopyTexSubImage2D; | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 157 | GLPtr<GrGLCreateProgramProc> fCreateProgram; | 
|  | 158 | GLPtr<GrGLCreateShaderProc> fCreateShader; | 
|  | 159 | GLPtr<GrGLCullFaceProc> fCullFace; | 
|  | 160 | GLPtr<GrGLDeleteBuffersProc> fDeleteBuffers; | 
|  | 161 | GLPtr<GrGLDeleteFramebuffersProc> fDeleteFramebuffers; | 
|  | 162 | GLPtr<GrGLDeleteProgramProc> fDeleteProgram; | 
|  | 163 | GLPtr<GrGLDeleteQueriesProc> fDeleteQueries; | 
|  | 164 | GLPtr<GrGLDeleteRenderbuffersProc> fDeleteRenderbuffers; | 
|  | 165 | GLPtr<GrGLDeleteShaderProc> fDeleteShader; | 
|  | 166 | GLPtr<GrGLDeleteTexturesProc> fDeleteTextures; | 
| bsalomon@google.com | ecd8484 | 2013-03-01 15:36:02 +0000 | [diff] [blame] | 167 | GLPtr<GrGLDeleteVertexArraysProc> fDeleteVertexArrays; | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 168 | GLPtr<GrGLDepthMaskProc> fDepthMask; | 
|  | 169 | GLPtr<GrGLDisableProc> fDisable; | 
| commit-bot@chromium.org | 46fbfe0 | 2013-08-30 15:52:12 +0000 | [diff] [blame] | 170 | GLPtr<GrGLDisableClientStateProc> fDisableClientState; | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 171 | GLPtr<GrGLDisableVertexAttribArrayProc> fDisableVertexAttribArray; | 
|  | 172 | GLPtr<GrGLDrawArraysProc> fDrawArrays; | 
|  | 173 | GLPtr<GrGLDrawBufferProc> fDrawBuffer; | 
|  | 174 | GLPtr<GrGLDrawBuffersProc> fDrawBuffers; | 
|  | 175 | GLPtr<GrGLDrawElementsProc> fDrawElements; | 
|  | 176 | GLPtr<GrGLEnableProc> fEnable; | 
| commit-bot@chromium.org | 46fbfe0 | 2013-08-30 15:52:12 +0000 | [diff] [blame] | 177 | GLPtr<GrGLEnableClientStateProc> fEnableClientState; | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 178 | GLPtr<GrGLEnableVertexAttribArrayProc> fEnableVertexAttribArray; | 
|  | 179 | GLPtr<GrGLEndQueryProc> fEndQuery; | 
|  | 180 | GLPtr<GrGLFinishProc> fFinish; | 
|  | 181 | GLPtr<GrGLFlushProc> fFlush; | 
|  | 182 | GLPtr<GrGLFramebufferRenderbufferProc> fFramebufferRenderbuffer; | 
|  | 183 | GLPtr<GrGLFramebufferTexture2DProc> fFramebufferTexture2D; | 
| bsalomon@google.com | f3a60c0 | 2013-03-19 19:06:09 +0000 | [diff] [blame] | 184 | GLPtr<GrGLFramebufferTexture2DMultisampleProc> fFramebufferTexture2DMultisample; | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 185 | GLPtr<GrGLFrontFaceProc> fFrontFace; | 
|  | 186 | GLPtr<GrGLGenBuffersProc> fGenBuffers; | 
|  | 187 | GLPtr<GrGLGenFramebuffersProc> fGenFramebuffers; | 
| commit-bot@chromium.org | cffff79 | 2013-07-26 16:36:04 +0000 | [diff] [blame] | 188 | GLPtr<GrGLGenerateMipmapProc> fGenerateMipmap; | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 189 | GLPtr<GrGLGenQueriesProc> fGenQueries; | 
|  | 190 | GLPtr<GrGLGenRenderbuffersProc> fGenRenderbuffers; | 
|  | 191 | GLPtr<GrGLGenTexturesProc> fGenTextures; | 
| bsalomon@google.com | ecd8484 | 2013-03-01 15:36:02 +0000 | [diff] [blame] | 192 | GLPtr<GrGLGenVertexArraysProc> fGenVertexArrays; | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 193 | GLPtr<GrGLGetBufferParameterivProc> fGetBufferParameteriv; | 
|  | 194 | GLPtr<GrGLGetErrorProc> fGetError; | 
|  | 195 | GLPtr<GrGLGetFramebufferAttachmentParameterivProc> fGetFramebufferAttachmentParameteriv; | 
|  | 196 | GLPtr<GrGLGetIntegervProc> fGetIntegerv; | 
|  | 197 | GLPtr<GrGLGetQueryObjecti64vProc> fGetQueryObjecti64v; | 
|  | 198 | GLPtr<GrGLGetQueryObjectivProc> fGetQueryObjectiv; | 
|  | 199 | GLPtr<GrGLGetQueryObjectui64vProc> fGetQueryObjectui64v; | 
|  | 200 | GLPtr<GrGLGetQueryObjectuivProc> fGetQueryObjectuiv; | 
|  | 201 | GLPtr<GrGLGetQueryivProc> fGetQueryiv; | 
|  | 202 | GLPtr<GrGLGetProgramInfoLogProc> fGetProgramInfoLog; | 
|  | 203 | GLPtr<GrGLGetProgramivProc> fGetProgramiv; | 
|  | 204 | GLPtr<GrGLGetRenderbufferParameterivProc> fGetRenderbufferParameteriv; | 
|  | 205 | GLPtr<GrGLGetShaderInfoLogProc> fGetShaderInfoLog; | 
|  | 206 | GLPtr<GrGLGetShaderivProc> fGetShaderiv; | 
|  | 207 | GLPtr<GrGLGetStringProc> fGetString; | 
| bsalomon@google.com | 1744f97 | 2013-02-26 21:46:32 +0000 | [diff] [blame] | 208 | GLPtr<GrGLGetStringiProc> fGetStringi; | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 209 | GLPtr<GrGLGetTexLevelParameterivProc> fGetTexLevelParameteriv; | 
|  | 210 | GLPtr<GrGLGetUniformLocationProc> fGetUniformLocation; | 
|  | 211 | GLPtr<GrGLLineWidthProc> fLineWidth; | 
|  | 212 | GLPtr<GrGLLinkProgramProc> fLinkProgram; | 
| commit-bot@chromium.org | f5897f8 | 2013-09-03 17:50:50 +0000 | [diff] [blame] | 213 | GLPtr<GrGLLoadIdentityProc> fLoadIdentity; | 
|  | 214 | GLPtr<GrGLLoadMatrixfProc> fLoadMatrixf; | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 215 | GLPtr<GrGLMapBufferProc> fMapBuffer; | 
| commit-bot@chromium.org | f5897f8 | 2013-09-03 17:50:50 +0000 | [diff] [blame] | 216 | GLPtr<GrGLMatrixModeProc> fMatrixMode; | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 217 | GLPtr<GrGLPixelStoreiProc> fPixelStorei; | 
|  | 218 | GLPtr<GrGLQueryCounterProc> fQueryCounter; | 
|  | 219 | GLPtr<GrGLReadBufferProc> fReadBuffer; | 
|  | 220 | GLPtr<GrGLReadPixelsProc> fReadPixels; | 
|  | 221 | GLPtr<GrGLRenderbufferStorageProc> fRenderbufferStorage; | 
| commit-bot@chromium.org | a8e5a06 | 2013-09-05 23:44:09 +0000 | [diff] [blame] | 222 |  | 
| commit-bot@chromium.org | a8e5a06 | 2013-09-05 23:44:09 +0000 | [diff] [blame] | 223 | //  On OpenGL ES there are multiple incompatible extensions that add support for MSAA | 
|  | 224 | //  and ES3 adds MSAA support to the standard. On an ES3 driver we may still use the | 
|  | 225 | //  older extensions for performance reasons or due to ES3 driver bugs. We want the function | 
|  | 226 | //  that creates the GrGLInterface to provide all available functions and internally | 
|  | 227 | //  we will select among them. They all have a method called glRenderbufferStorageMultisample*. | 
|  | 228 | //  So we have separate function pointers for GL_IMG/EXT_multisampled_to_texture, | 
|  | 229 | //  GL_CHROMIUM/ANGLE_framebuffer_multisample/ES3, and GL_APPLE_framebuffer_multisample | 
|  | 230 | //  variations. | 
|  | 231 | // | 
|  | 232 | //  If a driver supports multiple GL_ARB_framebuffer_multisample-style extensions then we will | 
|  | 233 | //  assume the function pointers for the standard (or equivalent GL_ARB) version have | 
|  | 234 | //  been preferred over GL_EXT, GL_CHROMIUM, or GL_ANGLE variations that have reduced | 
|  | 235 | //  functionality. | 
|  | 236 |  | 
|  | 237 | //  GL_EXT_multisampled_render_to_texture (preferred) or GL_IMG_multisampled_render_to_texture | 
|  | 238 | GLPtr<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisampleES2EXT; | 
|  | 239 | //  GL_APPLE_framebuffer_multisample | 
|  | 240 | GLPtr<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisampleES2APPLE; | 
| commit-bot@chromium.org | 92b7884 | 2014-01-16 20:49:46 +0000 | [diff] [blame^] | 241 |  | 
| commit-bot@chromium.org | a8e5a06 | 2013-09-05 23:44:09 +0000 | [diff] [blame] | 242 | //  This is used to store the pointer for GL_ARB/EXT/ANGLE/CHROMIUM_framebuffer_multisample or | 
|  | 243 | //  the standard function in ES3+ or GL 3.0+. | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 244 | GLPtr<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisample; | 
| commit-bot@chromium.org | a8e5a06 | 2013-09-05 23:44:09 +0000 | [diff] [blame] | 245 |  | 
| commit-bot@chromium.org | d3baf20 | 2013-11-07 22:06:08 +0000 | [diff] [blame] | 246 | // Pointer to BindUniformLocationCHROMIUM from the GL_CHROMIUM_bind_uniform_location extension. | 
|  | 247 | GLPtr<GrGLBindUniformLocation> fBindUniformLocation; | 
|  | 248 |  | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 249 | GLPtr<GrGLResolveMultisampleFramebufferProc> fResolveMultisampleFramebuffer; | 
|  | 250 | GLPtr<GrGLScissorProc> fScissor; | 
|  | 251 | GLPtr<GrGLShaderSourceProc> fShaderSource; | 
|  | 252 | GLPtr<GrGLStencilFuncProc> fStencilFunc; | 
|  | 253 | GLPtr<GrGLStencilFuncSeparateProc> fStencilFuncSeparate; | 
|  | 254 | GLPtr<GrGLStencilMaskProc> fStencilMask; | 
|  | 255 | GLPtr<GrGLStencilMaskSeparateProc> fStencilMaskSeparate; | 
|  | 256 | GLPtr<GrGLStencilOpProc> fStencilOp; | 
|  | 257 | GLPtr<GrGLStencilOpSeparateProc> fStencilOpSeparate; | 
| commit-bot@chromium.org | 46fbfe0 | 2013-08-30 15:52:12 +0000 | [diff] [blame] | 258 | GLPtr<GrGLTexGenfProc> fTexGenf; | 
|  | 259 | GLPtr<GrGLTexGenfvProc> fTexGenfv; | 
|  | 260 | GLPtr<GrGLTexGeniProc> fTexGeni; | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 261 | GLPtr<GrGLTexImage2DProc> fTexImage2D; | 
|  | 262 | GLPtr<GrGLTexParameteriProc> fTexParameteri; | 
| bsalomon@google.com | 4d063de | 2012-05-31 17:59:23 +0000 | [diff] [blame] | 263 | GLPtr<GrGLTexParameterivProc> fTexParameteriv; | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 264 | GLPtr<GrGLTexSubImage2DProc> fTexSubImage2D; | 
|  | 265 | GLPtr<GrGLTexStorage2DProc> fTexStorage2D; | 
| robertphillips@google.com | a6ffb58 | 2013-04-29 16:50:17 +0000 | [diff] [blame] | 266 | GLPtr<GrGLDiscardFramebufferProc> fDiscardFramebuffer; | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 267 | GLPtr<GrGLUniform1fProc> fUniform1f; | 
|  | 268 | GLPtr<GrGLUniform1iProc> fUniform1i; | 
|  | 269 | GLPtr<GrGLUniform1fvProc> fUniform1fv; | 
|  | 270 | GLPtr<GrGLUniform1ivProc> fUniform1iv; | 
|  | 271 | GLPtr<GrGLUniform2fProc> fUniform2f; | 
|  | 272 | GLPtr<GrGLUniform2iProc> fUniform2i; | 
|  | 273 | GLPtr<GrGLUniform2fvProc> fUniform2fv; | 
|  | 274 | GLPtr<GrGLUniform2ivProc> fUniform2iv; | 
|  | 275 | GLPtr<GrGLUniform3fProc> fUniform3f; | 
|  | 276 | GLPtr<GrGLUniform3iProc> fUniform3i; | 
|  | 277 | GLPtr<GrGLUniform3fvProc> fUniform3fv; | 
|  | 278 | GLPtr<GrGLUniform3ivProc> fUniform3iv; | 
|  | 279 | GLPtr<GrGLUniform4fProc> fUniform4f; | 
|  | 280 | GLPtr<GrGLUniform4iProc> fUniform4i; | 
|  | 281 | GLPtr<GrGLUniform4fvProc> fUniform4fv; | 
|  | 282 | GLPtr<GrGLUniform4ivProc> fUniform4iv; | 
|  | 283 | GLPtr<GrGLUniformMatrix2fvProc> fUniformMatrix2fv; | 
|  | 284 | GLPtr<GrGLUniformMatrix3fvProc> fUniformMatrix3fv; | 
|  | 285 | GLPtr<GrGLUniformMatrix4fvProc> fUniformMatrix4fv; | 
|  | 286 | GLPtr<GrGLUnmapBufferProc> fUnmapBuffer; | 
|  | 287 | GLPtr<GrGLUseProgramProc> fUseProgram; | 
|  | 288 | GLPtr<GrGLVertexAttrib4fvProc> fVertexAttrib4fv; | 
|  | 289 | GLPtr<GrGLVertexAttribPointerProc> fVertexAttribPointer; | 
| commit-bot@chromium.org | 46fbfe0 | 2013-08-30 15:52:12 +0000 | [diff] [blame] | 290 | GLPtr<GrGLVertexPointerProc> fVertexPointer; | 
| bsalomon@google.com | ba800e2 | 2012-03-29 21:04:52 +0000 | [diff] [blame] | 291 | GLPtr<GrGLViewportProc> fViewport; | 
| bsalomon@google.com | 271cffc | 2011-05-20 14:13:56 +0000 | [diff] [blame] | 292 |  | 
| bsalomon@google.com | fe11cb6 | 2012-06-06 15:17:54 +0000 | [diff] [blame] | 293 | // Experimental: Functions for GL_NV_path_rendering. These will be | 
| rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 294 | // alphabetized with the above functions once this is fully supported | 
| bsalomon@google.com | fe11cb6 | 2012-06-06 15:17:54 +0000 | [diff] [blame] | 295 | // (and functions we are unlikely to use will possibly be omitted). | 
| bsalomon@google.com | fe11cb6 | 2012-06-06 15:17:54 +0000 | [diff] [blame] | 296 | GLPtr<GrGLPathCommandsProc> fPathCommands; | 
|  | 297 | GLPtr<GrGLPathCoordsProc> fPathCoords; | 
|  | 298 | GLPtr<GrGLPathSubCommandsProc> fPathSubCommands; | 
|  | 299 | GLPtr<GrGLPathSubCoordsProc> fPathSubCoords; | 
|  | 300 | GLPtr<GrGLPathStringProc> fPathString; | 
|  | 301 | GLPtr<GrGLPathGlyphsProc> fPathGlyphs; | 
|  | 302 | GLPtr<GrGLPathGlyphRangeProc> fPathGlyphRange; | 
|  | 303 | GLPtr<GrGLWeightPathsProc> fWeightPaths; | 
|  | 304 | GLPtr<GrGLCopyPathProc> fCopyPath; | 
|  | 305 | GLPtr<GrGLInterpolatePathsProc> fInterpolatePaths; | 
|  | 306 | GLPtr<GrGLTransformPathProc> fTransformPath; | 
|  | 307 | GLPtr<GrGLPathParameterivProc> fPathParameteriv; | 
|  | 308 | GLPtr<GrGLPathParameteriProc> fPathParameteri; | 
|  | 309 | GLPtr<GrGLPathParameterfvProc> fPathParameterfv; | 
|  | 310 | GLPtr<GrGLPathParameterfProc> fPathParameterf; | 
|  | 311 | GLPtr<GrGLPathDashArrayProc> fPathDashArray; | 
|  | 312 | GLPtr<GrGLGenPathsProc> fGenPaths; | 
|  | 313 | GLPtr<GrGLDeletePathsProc> fDeletePaths; | 
|  | 314 | GLPtr<GrGLIsPathProc> fIsPath; | 
|  | 315 | GLPtr<GrGLPathStencilFuncProc> fPathStencilFunc; | 
|  | 316 | GLPtr<GrGLPathStencilDepthOffsetProc> fPathStencilDepthOffset; | 
|  | 317 | GLPtr<GrGLStencilFillPathProc> fStencilFillPath; | 
|  | 318 | GLPtr<GrGLStencilStrokePathProc> fStencilStrokePath; | 
|  | 319 | GLPtr<GrGLStencilFillPathInstancedProc> fStencilFillPathInstanced; | 
|  | 320 | GLPtr<GrGLStencilStrokePathInstancedProc> fStencilStrokePathInstanced; | 
|  | 321 | GLPtr<GrGLPathCoverDepthFuncProc> fPathCoverDepthFunc; | 
|  | 322 | GLPtr<GrGLPathColorGenProc> fPathColorGen; | 
|  | 323 | GLPtr<GrGLPathTexGenProc> fPathTexGen; | 
|  | 324 | GLPtr<GrGLPathFogGenProc> fPathFogGen; | 
|  | 325 | GLPtr<GrGLCoverFillPathProc> fCoverFillPath; | 
|  | 326 | GLPtr<GrGLCoverStrokePathProc> fCoverStrokePath; | 
|  | 327 | GLPtr<GrGLCoverFillPathInstancedProc> fCoverFillPathInstanced; | 
|  | 328 | GLPtr<GrGLCoverStrokePathInstancedProc> fCoverStrokePathInstanced; | 
|  | 329 | GLPtr<GrGLGetPathParameterivProc> fGetPathParameteriv; | 
|  | 330 | GLPtr<GrGLGetPathParameterfvProc> fGetPathParameterfv; | 
|  | 331 | GLPtr<GrGLGetPathCommandsProc> fGetPathCommands; | 
|  | 332 | GLPtr<GrGLGetPathCoordsProc> fGetPathCoords; | 
|  | 333 | GLPtr<GrGLGetPathDashArrayProc> fGetPathDashArray; | 
|  | 334 | GLPtr<GrGLGetPathMetricsProc> fGetPathMetrics; | 
|  | 335 | GLPtr<GrGLGetPathMetricRangeProc> fGetPathMetricRange; | 
|  | 336 | GLPtr<GrGLGetPathSpacingProc> fGetPathSpacing; | 
|  | 337 | GLPtr<GrGLGetPathColorGenivProc> fGetPathColorGeniv; | 
|  | 338 | GLPtr<GrGLGetPathColorGenfvProc> fGetPathColorGenfv; | 
|  | 339 | GLPtr<GrGLGetPathTexGenivProc> fGetPathTexGeniv; | 
|  | 340 | GLPtr<GrGLGetPathTexGenfvProc> fGetPathTexGenfv; | 
|  | 341 | GLPtr<GrGLIsPointInFillPathProc> fIsPointInFillPath; | 
|  | 342 | GLPtr<GrGLIsPointInStrokePathProc> fIsPointInStrokePath; | 
|  | 343 | GLPtr<GrGLGetPathLengthProc> fGetPathLength; | 
|  | 344 | GLPtr<GrGLPointAlongPathProc> fPointAlongPath; | 
|  | 345 |  | 
| bsalomon@google.com | 56bfc5a | 2011-09-01 13:28:16 +0000 | [diff] [blame] | 346 | // Per-GL func callback | 
|  | 347 | #if GR_GL_PER_GL_FUNC_CALLBACK | 
|  | 348 | GrGLInterfaceCallbackProc fCallback; | 
|  | 349 | GrGLInterfaceCallbackData fCallbackData; | 
|  | 350 | #endif | 
|  | 351 |  | 
| bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 352 | }; | 
| twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 353 |  | 
|  | 354 | #endif |