• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
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.
6  */
7 
8 #ifndef GrGLInterface_DEFINED
9 #define GrGLInterface_DEFINED
10 
11 #include "GrGLFunctions.h"
12 #include "GrGLExtensions.h"
13 #include "SkRefCnt.h"
14 
15 ////////////////////////////////////////////////////////////////////////////////
16 
17 /**
18  * Rather than depend on platform-specific GL headers and libraries, we require
19  * the client to provide a struct of GL function pointers. This struct can be
20  * specified per-GrContext as a parameter to GrContext::Create. If NULL is
21  * passed to Create then a "default" GL interface is created. If the default is
22  * also NULL GrContext creation will fail.
23  *
24  * The default interface is returned by GrGLDefaultInterface. This function's
25  * implementation is platform-specific. Several have been provided, along with
26  * an implementation that simply returns NULL.
27  *
28  * By defining GR_GL_PER_GL_CALL_IFACE_CALLBACK to 1 the client can specify a
29  * callback function that will be called prior to each GL function call. See
30  * comments in GrGLConfig.h
31  */
32 
33 typedef void(*GrGLFuncPtr)();
34 
35 struct GrGLInterface;
36 
37 const GrGLInterface* GrGLDefaultInterface();
38 
39 /**
40  * Creates a GrGLInterface for a "native" GL context (e.g. WGL on windows,
41  * GLX on linux, AGL on Mac). The interface is only valid for the GL context
42  * that is current when the interface is created.
43  */
44 SK_API const GrGLInterface* GrGLCreateNativeInterface();
45 
46 #if GR_GL_PER_GL_FUNC_CALLBACK
47 typedef void (*GrGLInterfaceCallbackProc)(const GrGLInterface*);
48 typedef intptr_t GrGLInterfaceCallbackData;
49 #endif
50 
51 /**
52  * Creates a null GrGLInterface that doesn't draw anything. Used for measuring
53  * CPU overhead. TODO: We would like to move this to tools/gpu/gl/null but currently
54  * Chromium is using it in its unit tests.
55  */
56 const SK_API GrGLInterface* GrGLCreateNullInterface(bool enableNVPR = false);
57 
58 /** Function that returns a new interface identical to "interface" but with support for
59     test version of GL_EXT_debug_marker. */
60 const GrGLInterface* GrGLInterfaceAddTestDebugMarker(const GrGLInterface*,
61                                                      GrGLInsertEventMarkerProc insertEventMarkerFn,
62                                                      GrGLPushGroupMarkerProc pushGroupMarkerFn,
63                                                      GrGLPopGroupMarkerProc popGroupMarkerFn);
64 
65 /**
66  * GrContext uses the following interface to make all calls into OpenGL. When a
67  * GrContext is created it is given a GrGLInterface. The interface's function
68  * pointers must be valid for the OpenGL context associated with the GrContext.
69  * On some platforms, such as Windows, function pointers for OpenGL extensions
70  * may vary between OpenGL contexts. So the caller must be careful to use a
71  * GrGLInterface initialized for the correct context. All functions that should
72  * be available based on the OpenGL's version and extension string must be
73  * non-NULL or GrContext creation will fail. This can be tested with the
74  * validate() method when the OpenGL context has been made current.
75  */
76 struct SK_API GrGLInterface : public SkRefCnt {
77 private:
78     typedef SkRefCnt INHERITED;
79 
80 public:
81     GrGLInterface();
82 
83     static GrGLInterface* NewClone(const GrGLInterface*);
84 
85     // Validates that the GrGLInterface supports its advertised standard. This means the necessary
86     // function pointers have been initialized for both the GL version and any advertised
87     // extensions.
88     bool validate() const;
89 
90     // Indicates the type of GL implementation
91     union {
92         GrGLStandard fStandard;
93         GrGLStandard fBindingsExported; // Legacy name, will be remove when Chromium is updated.
94     };
95 
96     GrGLExtensions fExtensions;
97 
hasExtensionGrGLInterface98     bool hasExtension(const char ext[]) const { return fExtensions.has(ext); }
99 
100     /**
101      * The function pointers are in a struct so that we can have a compiler generated assignment
102      * operator.
103      */
104     struct Functions {
105         GrGLFunction<GrGLActiveTextureProc> fActiveTexture;
106         GrGLFunction<GrGLAttachShaderProc> fAttachShader;
107         GrGLFunction<GrGLBeginQueryProc> fBeginQuery;
108         GrGLFunction<GrGLBindAttribLocationProc> fBindAttribLocation;
109         GrGLFunction<GrGLBindBufferProc> fBindBuffer;
110         GrGLFunction<GrGLBindFragDataLocationProc> fBindFragDataLocation;
111         GrGLFunction<GrGLBindFragDataLocationIndexedProc> fBindFragDataLocationIndexed;
112         GrGLFunction<GrGLBindFramebufferProc> fBindFramebuffer;
113         GrGLFunction<GrGLBindRenderbufferProc> fBindRenderbuffer;
114         GrGLFunction<GrGLBindTextureProc> fBindTexture;
115         GrGLFunction<GrGLBindImageTextureProc> fBindImageTexture;
116         GrGLFunction<GrGLBindVertexArrayProc> fBindVertexArray;
117         GrGLFunction<GrGLBlendBarrierProc> fBlendBarrier;
118         GrGLFunction<GrGLBlendColorProc> fBlendColor;
119         GrGLFunction<GrGLBlendEquationProc> fBlendEquation;
120         GrGLFunction<GrGLBlendFuncProc> fBlendFunc;
121         GrGLFunction<GrGLBlitFramebufferProc> fBlitFramebuffer;
122         GrGLFunction<GrGLBufferDataProc> fBufferData;
123         GrGLFunction<GrGLBufferSubDataProc> fBufferSubData;
124         GrGLFunction<GrGLCheckFramebufferStatusProc> fCheckFramebufferStatus;
125         GrGLFunction<GrGLClearProc> fClear;
126         GrGLFunction<GrGLClearColorProc> fClearColor;
127         GrGLFunction<GrGLClearStencilProc> fClearStencil;
128         GrGLFunction<GrGLClearTexImageProc> fClearTexImage;
129         GrGLFunction<GrGLClearTexSubImageProc> fClearTexSubImage;
130         GrGLFunction<GrGLColorMaskProc> fColorMask;
131         GrGLFunction<GrGLCompileShaderProc> fCompileShader;
132         GrGLFunction<GrGLCompressedTexImage2DProc> fCompressedTexImage2D;
133         GrGLFunction<GrGLCompressedTexSubImage2DProc> fCompressedTexSubImage2D;
134         GrGLFunction<GrGLCopyTexSubImage2DProc> fCopyTexSubImage2D;
135         GrGLFunction<GrGLCreateProgramProc> fCreateProgram;
136         GrGLFunction<GrGLCreateShaderProc> fCreateShader;
137         GrGLFunction<GrGLCullFaceProc> fCullFace;
138         GrGLFunction<GrGLDeleteBuffersProc> fDeleteBuffers;
139         GrGLFunction<GrGLDeleteFramebuffersProc> fDeleteFramebuffers;
140         GrGLFunction<GrGLDeleteProgramProc> fDeleteProgram;
141         GrGLFunction<GrGLDeleteQueriesProc> fDeleteQueries;
142         GrGLFunction<GrGLDeleteRenderbuffersProc> fDeleteRenderbuffers;
143         GrGLFunction<GrGLDeleteShaderProc> fDeleteShader;
144         GrGLFunction<GrGLDeleteTexturesProc> fDeleteTextures;
145         GrGLFunction<GrGLDeleteVertexArraysProc> fDeleteVertexArrays;
146         GrGLFunction<GrGLDepthMaskProc> fDepthMask;
147         GrGLFunction<GrGLDisableProc> fDisable;
148         GrGLFunction<GrGLDisableVertexAttribArrayProc> fDisableVertexAttribArray;
149         GrGLFunction<GrGLDrawArraysProc> fDrawArrays;
150         GrGLFunction<GrGLDrawArraysIndirectProc> fDrawArraysIndirect;
151         GrGLFunction<GrGLDrawArraysInstancedProc> fDrawArraysInstanced;
152         GrGLFunction<GrGLDrawBufferProc> fDrawBuffer;
153         GrGLFunction<GrGLDrawBuffersProc> fDrawBuffers;
154         GrGLFunction<GrGLDrawElementsProc> fDrawElements;
155         GrGLFunction<GrGLDrawElementsIndirectProc> fDrawElementsIndirect;
156         GrGLFunction<GrGLDrawElementsInstancedProc> fDrawElementsInstanced;
157         GrGLFunction<GrGLDrawRangeElementsProc> fDrawRangeElements;
158         GrGLFunction<GrGLEnableProc> fEnable;
159         GrGLFunction<GrGLEnableVertexAttribArrayProc> fEnableVertexAttribArray;
160         GrGLFunction<GrGLEndQueryProc> fEndQuery;
161         GrGLFunction<GrGLFinishProc> fFinish;
162         GrGLFunction<GrGLFlushProc> fFlush;
163         GrGLFunction<GrGLFlushMappedBufferRangeProc> fFlushMappedBufferRange;
164         GrGLFunction<GrGLFramebufferRenderbufferProc> fFramebufferRenderbuffer;
165         GrGLFunction<GrGLFramebufferTexture2DProc> fFramebufferTexture2D;
166         GrGLFunction<GrGLFramebufferTexture2DMultisampleProc> fFramebufferTexture2DMultisample;
167         GrGLFunction<GrGLFrontFaceProc> fFrontFace;
168         GrGLFunction<GrGLGenBuffersProc> fGenBuffers;
169         GrGLFunction<GrGLGenFramebuffersProc> fGenFramebuffers;
170         GrGLFunction<GrGLGenerateMipmapProc> fGenerateMipmap;
171         GrGLFunction<GrGLGenQueriesProc> fGenQueries;
172         GrGLFunction<GrGLGenRenderbuffersProc> fGenRenderbuffers;
173         GrGLFunction<GrGLGenTexturesProc> fGenTextures;
174         GrGLFunction<GrGLGenVertexArraysProc> fGenVertexArrays;
175         GrGLFunction<GrGLGetBufferParameterivProc> fGetBufferParameteriv;
176         GrGLFunction<GrGLGetErrorProc> fGetError;
177         GrGLFunction<GrGLGetFramebufferAttachmentParameterivProc> fGetFramebufferAttachmentParameteriv;
178         GrGLFunction<GrGLGetIntegervProc> fGetIntegerv;
179         GrGLFunction<GrGLGetMultisamplefvProc> fGetMultisamplefv;
180         GrGLFunction<GrGLGetQueryObjecti64vProc> fGetQueryObjecti64v;
181         GrGLFunction<GrGLGetQueryObjectivProc> fGetQueryObjectiv;
182         GrGLFunction<GrGLGetQueryObjectui64vProc> fGetQueryObjectui64v;
183         GrGLFunction<GrGLGetQueryObjectuivProc> fGetQueryObjectuiv;
184         GrGLFunction<GrGLGetQueryivProc> fGetQueryiv;
185         GrGLFunction<GrGLGetProgramInfoLogProc> fGetProgramInfoLog;
186         GrGLFunction<GrGLGetProgramivProc> fGetProgramiv;
187         GrGLFunction<GrGLGetRenderbufferParameterivProc> fGetRenderbufferParameteriv;
188         GrGLFunction<GrGLGetShaderInfoLogProc> fGetShaderInfoLog;
189         GrGLFunction<GrGLGetShaderivProc> fGetShaderiv;
190         GrGLFunction<GrGLGetShaderPrecisionFormatProc> fGetShaderPrecisionFormat;
191         GrGLFunction<GrGLGetStringProc> fGetString;
192         GrGLFunction<GrGLGetStringiProc> fGetStringi;
193         GrGLFunction<GrGLGetTexLevelParameterivProc> fGetTexLevelParameteriv;
194         GrGLFunction<GrGLGetUniformLocationProc> fGetUniformLocation;
195         GrGLFunction<GrGLInsertEventMarkerProc> fInsertEventMarker;
196         GrGLFunction<GrGLInvalidateBufferDataProc> fInvalidateBufferData;
197         GrGLFunction<GrGLInvalidateBufferSubDataProc> fInvalidateBufferSubData;
198         GrGLFunction<GrGLInvalidateFramebufferProc> fInvalidateFramebuffer;
199         GrGLFunction<GrGLInvalidateSubFramebufferProc> fInvalidateSubFramebuffer;
200         GrGLFunction<GrGLInvalidateTexImageProc> fInvalidateTexImage;
201         GrGLFunction<GrGLInvalidateTexSubImageProc> fInvalidateTexSubImage;
202         GrGLFunction<GrGLIsTextureProc> fIsTexture;
203         GrGLFunction<GrGLLineWidthProc> fLineWidth;
204         GrGLFunction<GrGLLinkProgramProc> fLinkProgram;
205         GrGLFunction<GrGLMapBufferProc> fMapBuffer;
206         GrGLFunction<GrGLMapBufferRangeProc> fMapBufferRange;
207         GrGLFunction<GrGLMapBufferSubDataProc> fMapBufferSubData;
208         GrGLFunction<GrGLMapTexSubImage2DProc> fMapTexSubImage2D;
209         GrGLFunction<GrGLMemoryBarrierProc> fMemoryBarrier;
210         GrGLFunction<GrGLMemoryBarrierByRegionProc> fMemoryBarrierByRegion;
211         GrGLFunction<GrGLMultiDrawArraysIndirectProc> fMultiDrawArraysIndirect;
212         GrGLFunction<GrGLMultiDrawElementsIndirectProc> fMultiDrawElementsIndirect;
213         GrGLFunction<GrGLPixelStoreiProc> fPixelStorei;
214         GrGLFunction<GrGLPolygonModeProc> fPolygonMode;
215         GrGLFunction<GrGLPopGroupMarkerProc> fPopGroupMarker;
216         GrGLFunction<GrGLPushGroupMarkerProc> fPushGroupMarker;
217         GrGLFunction<GrGLQueryCounterProc> fQueryCounter;
218         GrGLFunction<GrGLRasterSamplesProc> fRasterSamples;
219         GrGLFunction<GrGLReadBufferProc> fReadBuffer;
220         GrGLFunction<GrGLReadPixelsProc> fReadPixels;
221         GrGLFunction<GrGLRenderbufferStorageProc> fRenderbufferStorage;
222 
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         GrGLFunction<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisampleES2EXT;
239         //  GL_APPLE_framebuffer_multisample
240         GrGLFunction<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisampleES2APPLE;
241 
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+.
244         GrGLFunction<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisample;
245 
246         // Pointer to BindUniformLocationCHROMIUM from the GL_CHROMIUM_bind_uniform_location extension.
247         GrGLFunction<GrGLBindUniformLocationProc> fBindUniformLocation;
248 
249         GrGLFunction<GrGLResolveMultisampleFramebufferProc> fResolveMultisampleFramebuffer;
250         GrGLFunction<GrGLScissorProc> fScissor;
251         GrGLFunction<GrGLShaderSourceProc> fShaderSource;
252         GrGLFunction<GrGLStencilFuncProc> fStencilFunc;
253         GrGLFunction<GrGLStencilFuncSeparateProc> fStencilFuncSeparate;
254         GrGLFunction<GrGLStencilMaskProc> fStencilMask;
255         GrGLFunction<GrGLStencilMaskSeparateProc> fStencilMaskSeparate;
256         GrGLFunction<GrGLStencilOpProc> fStencilOp;
257         GrGLFunction<GrGLStencilOpSeparateProc> fStencilOpSeparate;
258         GrGLFunction<GrGLTexBufferProc> fTexBuffer;
259         GrGLFunction<GrGLTexBufferRangeProc> fTexBufferRange;
260         GrGLFunction<GrGLTexImage2DProc> fTexImage2D;
261         GrGLFunction<GrGLTexParameteriProc> fTexParameteri;
262         GrGLFunction<GrGLTexParameterivProc> fTexParameteriv;
263         GrGLFunction<GrGLTexSubImage2DProc> fTexSubImage2D;
264         GrGLFunction<GrGLTexStorage2DProc> fTexStorage2D;
265         GrGLFunction<GrGLTextureBarrierProc> fTextureBarrier;
266         GrGLFunction<GrGLDiscardFramebufferProc> fDiscardFramebuffer;
267         GrGLFunction<GrGLUniform1fProc> fUniform1f;
268         GrGLFunction<GrGLUniform1iProc> fUniform1i;
269         GrGLFunction<GrGLUniform1fvProc> fUniform1fv;
270         GrGLFunction<GrGLUniform1ivProc> fUniform1iv;
271         GrGLFunction<GrGLUniform2fProc> fUniform2f;
272         GrGLFunction<GrGLUniform2iProc> fUniform2i;
273         GrGLFunction<GrGLUniform2fvProc> fUniform2fv;
274         GrGLFunction<GrGLUniform2ivProc> fUniform2iv;
275         GrGLFunction<GrGLUniform3fProc> fUniform3f;
276         GrGLFunction<GrGLUniform3iProc> fUniform3i;
277         GrGLFunction<GrGLUniform3fvProc> fUniform3fv;
278         GrGLFunction<GrGLUniform3ivProc> fUniform3iv;
279         GrGLFunction<GrGLUniform4fProc> fUniform4f;
280         GrGLFunction<GrGLUniform4iProc> fUniform4i;
281         GrGLFunction<GrGLUniform4fvProc> fUniform4fv;
282         GrGLFunction<GrGLUniform4ivProc> fUniform4iv;
283         GrGLFunction<GrGLUniformMatrix2fvProc> fUniformMatrix2fv;
284         GrGLFunction<GrGLUniformMatrix3fvProc> fUniformMatrix3fv;
285         GrGLFunction<GrGLUniformMatrix4fvProc> fUniformMatrix4fv;
286         GrGLFunction<GrGLUnmapBufferProc> fUnmapBuffer;
287         GrGLFunction<GrGLUnmapBufferSubDataProc> fUnmapBufferSubData;
288         GrGLFunction<GrGLUnmapTexSubImage2DProc> fUnmapTexSubImage2D;
289         GrGLFunction<GrGLUseProgramProc> fUseProgram;
290         GrGLFunction<GrGLVertexAttrib1fProc> fVertexAttrib1f;
291         GrGLFunction<GrGLVertexAttrib2fvProc> fVertexAttrib2fv;
292         GrGLFunction<GrGLVertexAttrib3fvProc> fVertexAttrib3fv;
293         GrGLFunction<GrGLVertexAttrib4fvProc> fVertexAttrib4fv;
294         GrGLFunction<GrGLVertexAttribDivisorProc> fVertexAttribDivisor;
295         GrGLFunction<GrGLVertexAttribIPointerProc> fVertexAttribIPointer;
296         GrGLFunction<GrGLVertexAttribPointerProc> fVertexAttribPointer;
297         GrGLFunction<GrGLViewportProc> fViewport;
298 
299         /* GL_NV_path_rendering */
300         GrGLFunction<GrGLMatrixLoadfProc> fMatrixLoadf;
301         GrGLFunction<GrGLMatrixLoadIdentityProc> fMatrixLoadIdentity;
302         GrGLFunction<GrGLGetProgramResourceLocationProc> fGetProgramResourceLocation;
303         GrGLFunction<GrGLPathCommandsProc> fPathCommands;
304         GrGLFunction<GrGLPathParameteriProc> fPathParameteri;
305         GrGLFunction<GrGLPathParameterfProc> fPathParameterf;
306         GrGLFunction<GrGLGenPathsProc> fGenPaths;
307         GrGLFunction<GrGLDeletePathsProc> fDeletePaths;
308         GrGLFunction<GrGLIsPathProc> fIsPath;
309         GrGLFunction<GrGLPathStencilFuncProc> fPathStencilFunc;
310         GrGLFunction<GrGLStencilFillPathProc> fStencilFillPath;
311         GrGLFunction<GrGLStencilStrokePathProc> fStencilStrokePath;
312         GrGLFunction<GrGLStencilFillPathInstancedProc> fStencilFillPathInstanced;
313         GrGLFunction<GrGLStencilStrokePathInstancedProc> fStencilStrokePathInstanced;
314         GrGLFunction<GrGLCoverFillPathProc> fCoverFillPath;
315         GrGLFunction<GrGLCoverStrokePathProc> fCoverStrokePath;
316         GrGLFunction<GrGLCoverFillPathInstancedProc> fCoverFillPathInstanced;
317         GrGLFunction<GrGLCoverStrokePathInstancedProc> fCoverStrokePathInstanced;
318         // NV_path_rendering v1.2
319         GrGLFunction<GrGLStencilThenCoverFillPathProc> fStencilThenCoverFillPath;
320         GrGLFunction<GrGLStencilThenCoverStrokePathProc> fStencilThenCoverStrokePath;
321         GrGLFunction<GrGLStencilThenCoverFillPathInstancedProc> fStencilThenCoverFillPathInstanced;
322         GrGLFunction<GrGLStencilThenCoverStrokePathInstancedProc> fStencilThenCoverStrokePathInstanced;
323         // NV_path_rendering v1.3
324         GrGLFunction<GrGLProgramPathFragmentInputGenProc> fProgramPathFragmentInputGen;
325         // CHROMIUM_path_rendering
326         GrGLFunction<GrGLBindFragmentInputLocationProc> fBindFragmentInputLocation;
327 
328         /* NV_framebuffer_mixed_samples */
329         GrGLFunction<GrGLCoverageModulationProc> fCoverageModulation;
330 
331         /* NV_bindless_texture */
332         // We use the NVIDIA verson for now because it does not require dynamically uniform handles.
333         // We may switch the the ARB version and/or omit methods in the future.
334         GrGLFunction<GrGLGetTextureHandleProc> fGetTextureHandle;
335         GrGLFunction<GrGLGetTextureSamplerHandleProc> fGetTextureSamplerHandle;
336         GrGLFunction<GrGLMakeTextureHandleResidentProc> fMakeTextureHandleResident;
337         GrGLFunction<GrGLMakeTextureHandleNonResidentProc> fMakeTextureHandleNonResident;
338         GrGLFunction<GrGLGetImageHandleProc> fGetImageHandle;
339         GrGLFunction<GrGLMakeImageHandleResidentProc> fMakeImageHandleResident;
340         GrGLFunction<GrGLMakeImageHandleNonResidentProc> fMakeImageHandleNonResident;
341         GrGLFunction<GrGLIsTextureHandleResidentProc> fIsTextureHandleResident;
342         GrGLFunction<GrGLIsImageHandleResidentProc> fIsImageHandleResident;
343         GrGLFunction<GrGLUniformHandleui64Proc> fUniformHandleui64;
344         GrGLFunction<GrGLUniformHandleui64vProc> fUniformHandleui64v;
345         GrGLFunction<GrGLProgramUniformHandleui64Proc> fProgramUniformHandleui64;
346         GrGLFunction<GrGLProgramUniformHandleui64vProc> fProgramUniformHandleui64v;
347 
348         /* ARB_sample_shading */
349         GrGLFunction<GrGLMinSampleShadingProc> fMinSampleShading;
350 
351         /* EXT_direct_state_access */
352         // We use the EXT verson because it is more expansive and interacts with more extensions
353         // than the ARB or core (4.5) versions. We may switch and/or omit methods in the future.
354         GrGLFunction<GrGLTextureParameteriProc> fTextureParameteri;
355         GrGLFunction<GrGLTextureParameterivProc> fTextureParameteriv;
356         GrGLFunction<GrGLTextureParameterfProc> fTextureParameterf;
357         GrGLFunction<GrGLTextureParameterfvProc> fTextureParameterfv;
358         GrGLFunction<GrGLTextureImage1DProc> fTextureImage1D;
359         GrGLFunction<GrGLTextureImage2DProc> fTextureImage2D;
360         GrGLFunction<GrGLTextureSubImage1DProc> fTextureSubImage1D;
361         GrGLFunction<GrGLTextureSubImage2DProc> fTextureSubImage2D;
362         GrGLFunction<GrGLCopyTextureImage1DProc> fCopyTextureImage1D;
363         GrGLFunction<GrGLCopyTextureImage2DProc> fCopyTextureImage2D;
364         GrGLFunction<GrGLCopyTextureSubImage1DProc> fCopyTextureSubImage1D;
365         GrGLFunction<GrGLCopyTextureSubImage2DProc> fCopyTextureSubImage2D;
366         GrGLFunction<GrGLGetTextureImageProc> fGetTextureImage;
367         GrGLFunction<GrGLGetTextureParameterfvProc> fGetTextureParameterfv;
368         GrGLFunction<GrGLGetTextureParameterivProc> fGetTextureParameteriv;
369         GrGLFunction<GrGLGetTextureLevelParameterfvProc> fGetTextureLevelParameterfv;
370         GrGLFunction<GrGLGetTextureLevelParameterivProc> fGetTextureLevelParameteriv;
371         // OpenGL 1.2
372         GrGLFunction<GrGLTextureImage3DProc> fTextureImage3D;
373         GrGLFunction<GrGLTextureSubImage3DProc> fTextureSubImage3D;
374         GrGLFunction<GrGLCopyTextureSubImage3DProc> fCopyTextureSubImage3D;
375         GrGLFunction<GrGLCompressedTextureImage3DProc> fCompressedTextureImage3D;
376         GrGLFunction<GrGLCompressedTextureImage2DProc> fCompressedTextureImage2D;
377         GrGLFunction<GrGLCompressedTextureImage1DProc> fCompressedTextureImage1D;
378         GrGLFunction<GrGLCompressedTextureSubImage3DProc> fCompressedTextureSubImage3D;
379         GrGLFunction<GrGLCompressedTextureSubImage2DProc> fCompressedTextureSubImage2D;
380         GrGLFunction<GrGLCompressedTextureSubImage1DProc> fCompressedTextureSubImage1D;
381         GrGLFunction<GrGLGetCompressedTextureImageProc> fGetCompressedTextureImage;
382         // OpenGL 1.5
383         GrGLFunction<GrGLNamedBufferDataProc> fNamedBufferData;
384         GrGLFunction<GrGLNamedBufferSubDataProc> fNamedBufferSubData;
385         GrGLFunction<GrGLMapNamedBufferProc> fMapNamedBuffer;
386         GrGLFunction<GrGLUnmapNamedBufferProc> fUnmapNamedBuffer;
387         GrGLFunction<GrGLGetNamedBufferParameterivProc> fGetNamedBufferParameteriv;
388         GrGLFunction<GrGLGetNamedBufferPointervProc> fGetNamedBufferPointerv;
389         GrGLFunction<GrGLGetNamedBufferSubDataProc> fGetNamedBufferSubData;
390         // OpenGL 2.0
391         GrGLFunction<GrGLProgramUniform1fProc> fProgramUniform1f;
392         GrGLFunction<GrGLProgramUniform2fProc> fProgramUniform2f;
393         GrGLFunction<GrGLProgramUniform3fProc> fProgramUniform3f;
394         GrGLFunction<GrGLProgramUniform4fProc> fProgramUniform4f;
395         GrGLFunction<GrGLProgramUniform1iProc> fProgramUniform1i;
396         GrGLFunction<GrGLProgramUniform2iProc> fProgramUniform2i;
397         GrGLFunction<GrGLProgramUniform3iProc> fProgramUniform3i;
398         GrGLFunction<GrGLProgramUniform4iProc> fProgramUniform4i;
399         GrGLFunction<GrGLProgramUniform1fvProc> fProgramUniform1fv;
400         GrGLFunction<GrGLProgramUniform2fvProc> fProgramUniform2fv;
401         GrGLFunction<GrGLProgramUniform3fvProc> fProgramUniform3fv;
402         GrGLFunction<GrGLProgramUniform4fvProc> fProgramUniform4fv;
403         GrGLFunction<GrGLProgramUniform1ivProc> fProgramUniform1iv;
404         GrGLFunction<GrGLProgramUniform2ivProc> fProgramUniform2iv;
405         GrGLFunction<GrGLProgramUniform3ivProc> fProgramUniform3iv;
406         GrGLFunction<GrGLProgramUniform4ivProc> fProgramUniform4iv;
407         GrGLFunction<GrGLProgramUniformMatrix2fvProc> fProgramUniformMatrix2fv;
408         GrGLFunction<GrGLProgramUniformMatrix3fvProc> fProgramUniformMatrix3fv;
409         GrGLFunction<GrGLProgramUniformMatrix4fvProc> fProgramUniformMatrix4fv;
410         // OpenGL 2.1
411         GrGLFunction<GrGLProgramUniformMatrix2x3fvProc> fProgramUniformMatrix2x3fv;
412         GrGLFunction<GrGLProgramUniformMatrix3x2fvProc> fProgramUniformMatrix3x2fv;
413         GrGLFunction<GrGLProgramUniformMatrix2x4fvProc> fProgramUniformMatrix2x4fv;
414         GrGLFunction<GrGLProgramUniformMatrix4x2fvProc> fProgramUniformMatrix4x2fv;
415         GrGLFunction<GrGLProgramUniformMatrix3x4fvProc> fProgramUniformMatrix3x4fv;
416         GrGLFunction<GrGLProgramUniformMatrix4x3fvProc> fProgramUniformMatrix4x3fv;
417         // OpenGL 3.0
418         GrGLFunction<GrGLNamedRenderbufferStorageProc> fNamedRenderbufferStorage;
419         GrGLFunction<GrGLGetNamedRenderbufferParameterivProc> fGetNamedRenderbufferParameteriv;
420         GrGLFunction<GrGLNamedRenderbufferStorageMultisampleProc> fNamedRenderbufferStorageMultisample;
421         GrGLFunction<GrGLCheckNamedFramebufferStatusProc> fCheckNamedFramebufferStatus;
422         GrGLFunction<GrGLNamedFramebufferTexture1DProc> fNamedFramebufferTexture1D;
423         GrGLFunction<GrGLNamedFramebufferTexture2DProc> fNamedFramebufferTexture2D;
424         GrGLFunction<GrGLNamedFramebufferTexture3DProc> fNamedFramebufferTexture3D;
425         GrGLFunction<GrGLNamedFramebufferRenderbufferProc> fNamedFramebufferRenderbuffer;
426         GrGLFunction<GrGLGetNamedFramebufferAttachmentParameterivProc> fGetNamedFramebufferAttachmentParameteriv;
427         GrGLFunction<GrGLGenerateTextureMipmapProc> fGenerateTextureMipmap;
428         GrGLFunction<GrGLFramebufferDrawBufferProc> fFramebufferDrawBuffer;
429         GrGLFunction<GrGLFramebufferDrawBuffersProc> fFramebufferDrawBuffers;
430         GrGLFunction<GrGLFramebufferReadBufferProc> fFramebufferReadBuffer;
431         GrGLFunction<GrGLGetFramebufferParameterivProc> fGetFramebufferParameteriv;
432         GrGLFunction<GrGLNamedCopyBufferSubDataProc> fNamedCopyBufferSubData;
433         GrGLFunction<GrGLVertexArrayVertexOffsetProc> fVertexArrayVertexOffset;
434         GrGLFunction<GrGLVertexArrayColorOffsetProc> fVertexArrayColorOffset;
435         GrGLFunction<GrGLVertexArrayEdgeFlagOffsetProc> fVertexArrayEdgeFlagOffset;
436         GrGLFunction<GrGLVertexArrayIndexOffsetProc> fVertexArrayIndexOffset;
437         GrGLFunction<GrGLVertexArrayNormalOffsetProc> fVertexArrayNormalOffset;
438         GrGLFunction<GrGLVertexArrayTexCoordOffsetProc> fVertexArrayTexCoordOffset;
439         GrGLFunction<GrGLVertexArrayMultiTexCoordOffsetProc> fVertexArrayMultiTexCoordOffset;
440         GrGLFunction<GrGLVertexArrayFogCoordOffsetProc> fVertexArrayFogCoordOffset;
441         GrGLFunction<GrGLVertexArraySecondaryColorOffsetProc> fVertexArraySecondaryColorOffset;
442         GrGLFunction<GrGLVertexArrayVertexAttribOffsetProc> fVertexArrayVertexAttribOffset;
443         GrGLFunction<GrGLVertexArrayVertexAttribIOffsetProc> fVertexArrayVertexAttribIOffset;
444         GrGLFunction<GrGLEnableVertexArrayProc> fEnableVertexArray;
445         GrGLFunction<GrGLDisableVertexArrayProc> fDisableVertexArray;
446         GrGLFunction<GrGLEnableVertexArrayAttribProc> fEnableVertexArrayAttrib;
447         GrGLFunction<GrGLDisableVertexArrayAttribProc> fDisableVertexArrayAttrib;
448         GrGLFunction<GrGLGetVertexArrayIntegervProc> fGetVertexArrayIntegerv;
449         GrGLFunction<GrGLGetVertexArrayPointervProc> fGetVertexArrayPointerv;
450         GrGLFunction<GrGLGetVertexArrayIntegeri_vProc> fGetVertexArrayIntegeri_v;
451         GrGLFunction<GrGLGetVertexArrayPointeri_vProc> fGetVertexArrayPointeri_v;
452         GrGLFunction<GrGLMapNamedBufferRangeProc> fMapNamedBufferRange;
453         GrGLFunction<GrGLFlushMappedNamedBufferRangeProc> fFlushMappedNamedBufferRange;
454         // OpenGL 3.1
455         GrGLFunction<GrGLTextureBufferProc> fTextureBuffer;
456 
457         /* ARB_sync */
458         GrGLFunction<GrGLFenceSyncProc> fFenceSync;
459         GrGLFunction<GrGLClientWaitSyncProc> fClientWaitSync;
460         GrGLFunction<GrGLWaitSyncProc> fWaitSync;
461         GrGLFunction<GrGLDeleteSyncProc> fDeleteSync;
462 
463         /* ARB_internalforamt_query */
464         GrGLFunction<GrGLGetInternalformativProc> fGetInternalformativ;
465 
466         /* KHR_debug */
467         GrGLFunction<GrGLDebugMessageControlProc> fDebugMessageControl;
468         GrGLFunction<GrGLDebugMessageInsertProc> fDebugMessageInsert;
469         GrGLFunction<GrGLDebugMessageCallbackProc> fDebugMessageCallback;
470         GrGLFunction<GrGLGetDebugMessageLogProc> fGetDebugMessageLog;
471         GrGLFunction<GrGLPushDebugGroupProc> fPushDebugGroup;
472         GrGLFunction<GrGLPopDebugGroupProc> fPopDebugGroup;
473         GrGLFunction<GrGLObjectLabelProc> fObjectLabel;
474 
475         /* EXT_window_rectangles */
476         GrGLFunction<GrGLWindowRectanglesProc> fWindowRectangles;
477 
478         /* EGL functions */
479         GrGLFunction<GrEGLCreateImageProc> fEGLCreateImage;
480         GrGLFunction<GrEGLDestroyImageProc> fEGLDestroyImage;
481     } fFunctions;
482 
483     // This exists for internal testing.
abandonGrGLInterface484     virtual void abandon() const {}
485 };
486 
487 #endif
488