blob: fc32ed621d636ff1fdd6699dda9957fb5f9528e3 [file] [log] [blame]
twiz@google.com59a190b2011-03-14 21:23:01 +00001/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00002 * 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.com59a190b2011-03-14 21:23:01 +00006 */
7
twiz@google.com59a190b2011-03-14 21:23:01 +00008#ifndef GrGLInterface_DEFINED
9#define GrGLInterface_DEFINED
10
bsalomon@google.com637d5e92012-05-07 21:33:56 +000011#include "GrGLFunctions.h"
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +000012#include "GrGLExtensions.h"
commit-bot@chromium.orga4de8c22013-09-09 13:38:37 +000013#include "SkRefCnt.h"
twiz@google.com59a190b2011-03-14 21:23:01 +000014
twiz@google.com59a190b2011-03-14 21:23:01 +000015////////////////////////////////////////////////////////////////////////////////
16
Brian Salomon3d6801e2017-12-11 10:06:31 -050017typedef void(*GrGLFuncPtr)();
18struct GrGLInterface;
19
20
twiz@google.com59a190b2011-03-14 21:23:01 +000021/**
bsalomon@google.com0b77d682011-08-19 13:28:54 +000022 * 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 Salomonc1b9c102018-04-06 09:18:00 -040024 * 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.com0b77d682011-08-19 13:28:54 +000027 *
Brian Salomonc1b9c102018-04-06 09:18:00 -040028 * 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.com59a190b2011-03-14 21:23:01 +000032 */
Brian Salomon3d6801e2017-12-11 10:06:31 -050033SK_API sk_sp<const GrGLInterface> GrGLMakeNativeInterface();
34// Deprecated alternative to GrGLMakeNativeInterface().
halcanary0fc1dbe2015-09-21 08:22:19 -070035SK_API const GrGLInterface* GrGLCreateNativeInterface();
bsalomon@google.com373a6632011-10-19 20:43:20 +000036
bsalomon@google.com74913722011-10-27 20:44:19 +000037/**
38 * Creates a null GrGLInterface that doesn't draw anything. Used for measuring
bsalomon3724e572016-03-30 18:56:19 -070039 * 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.com74913722011-10-27 20:44:19 +000041 */
svaisanenb988ecf2016-04-20 00:36:53 -070042const SK_API GrGLInterface* GrGLCreateNullInterface(bool enableNVPR = false);
bsalomon@google.com74913722011-10-27 20:44:19 +000043
commit-bot@chromium.orgd8ed8512014-01-24 20:49:44 +000044/**
bsalomon@google.comcc61b172012-05-07 21:45:48 +000045 * 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.combf2a4692011-05-04 12:35:39 +000054 */
commit-bot@chromium.orga4de8c22013-09-09 13:38:37 +000055struct SK_API GrGLInterface : public SkRefCnt {
bsalomon@google.comba800e22012-03-29 21:04:52 +000056private:
commit-bot@chromium.orga4de8c22013-09-09 13:38:37 +000057 typedef SkRefCnt INHERITED;
robertphillips@google.com15e9d3e2012-06-21 20:25:03 +000058
bsalomon@google.comba800e22012-03-29 21:04:52 +000059public:
bsalomon@google.com0b77d682011-08-19 13:28:54 +000060 GrGLInterface();
61
commit-bot@chromium.org9e90aed2014-01-16 16:35:09 +000062 // 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.com89ec61e2012-02-10 20:05:18 +000066
commit-bot@chromium.org9e90aed2014-01-16 16:35:09 +000067 // 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.comb65e0cb2011-03-18 20:41:44 +000072
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +000073 GrGLExtensions fExtensions;
74
commit-bot@chromium.orgf5355612014-02-28 20:28:50 +000075 bool hasExtension(const char ext[]) const { return fExtensions.has(ext); }
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +000076
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +000077 /**
78 * The function pointers are in a struct so that we can have a compiler generated assignment
79 * operator.
80 */
81 struct Functions {
Brian Salomon2424ec42018-08-24 10:26:42 -040082 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 Salomona2a94a42018-10-16 10:54:10 -040091 GrGLFunction<GrGLBindSamplerFn> fBindSampler;
Brian Salomon2424ec42018-08-24 10:26:42 -040092 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 Salomona2a94a42018-10-16 10:54:10 -0400120 GrGLFunction<GrGLDeleteSamplersFn> fDeleteSamplers;
Brian Salomon2424ec42018-08-24 10:26:42 -0400121 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 Salomona2a94a42018-10-16 10:54:10 -0400151 GrGLFunction<GrGLGenSamplersFn> fGenSamplers;
Brian Salomon2424ec42018-08-24 10:26:42 -0400152 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 Salomon2424ec42018-08-24 10:26:42 -0400198 GrGLFunction<GrGLReadBufferFn> fReadBuffer;
199 GrGLFunction<GrGLReadPixelsFn> fReadPixels;
200 GrGLFunction<GrGLRenderbufferStorageFn> fRenderbufferStorage;
commit-bot@chromium.orga8e5a062013-09-05 23:44:09 +0000201
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000202 // 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.orga8e5a062013-09-05 23:44:09 +0000215
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000216 // GL_EXT_multisampled_render_to_texture (preferred) or GL_IMG_multisampled_render_to_texture
Brian Salomon2424ec42018-08-24 10:26:42 -0400217 GrGLFunction<GrGLRenderbufferStorageMultisampleFn> fRenderbufferStorageMultisampleES2EXT;
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000218 // GL_APPLE_framebuffer_multisample
Brian Salomon2424ec42018-08-24 10:26:42 -0400219 GrGLFunction<GrGLRenderbufferStorageMultisampleFn> fRenderbufferStorageMultisampleES2APPLE;
commit-bot@chromium.org92b78842014-01-16 20:49:46 +0000220
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000221 // 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 Salomon2424ec42018-08-24 10:26:42 -0400223 GrGLFunction<GrGLRenderbufferStorageMultisampleFn> fRenderbufferStorageMultisample;
commit-bot@chromium.orga8e5a062013-09-05 23:44:09 +0000224
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000225 // Pointer to BindUniformLocationCHROMIUM from the GL_CHROMIUM_bind_uniform_location extension.
Brian Salomon2424ec42018-08-24 10:26:42 -0400226 GrGLFunction<GrGLBindUniformLocationFn> fBindUniformLocation;
commit-bot@chromium.orgd3baf202013-11-07 22:06:08 +0000227
Brian Salomon2424ec42018-08-24 10:26:42 -0400228 GrGLFunction<GrGLResolveMultisampleFramebufferFn> fResolveMultisampleFramebuffer;
Brian Salomona2a94a42018-10-16 10:54:10 -0400229 GrGLFunction<GrGLSamplerParameteriFn> fSamplerParameteri;
230 GrGLFunction<GrGLSamplerParameterivFn> fSamplerParameteriv;
Brian Salomon2424ec42018-08-24 10:26:42 -0400231 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 Salomon0a7e58f2018-12-07 19:20:19 -0500242 GrGLFunction<GrGLTexParameterfFn> fTexParameterf;
243 GrGLFunction<GrGLTexParameterfvFn> fTexParameterfv;
Brian Salomon2424ec42018-08-24 10:26:42 -0400244 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.com271cffc2011-05-20 14:13:56 +0000281
cdalton626e1ff2015-06-12 13:56:46 -0700282 /* GL_NV_path_rendering */
Brian Salomon2424ec42018-08-24 10:26:42 -0400283 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;
cdaltonc7103a12014-08-11 14:05:05 -0700301 // NV_path_rendering v1.2
Brian Salomon2424ec42018-08-24 10:26:42 -0400302 GrGLFunction<GrGLStencilThenCoverFillPathFn> fStencilThenCoverFillPath;
303 GrGLFunction<GrGLStencilThenCoverStrokePathFn> fStencilThenCoverStrokePath;
304 GrGLFunction<GrGLStencilThenCoverFillPathInstancedFn> fStencilThenCoverFillPathInstanced;
305 GrGLFunction<GrGLStencilThenCoverStrokePathInstancedFn> fStencilThenCoverStrokePathInstanced;
cdaltonc7103a12014-08-11 14:05:05 -0700306 // NV_path_rendering v1.3
Brian Salomon2424ec42018-08-24 10:26:42 -0400307 GrGLFunction<GrGLProgramPathFragmentInputGenFn> fProgramPathFragmentInputGen;
kkinnunen6bb6d402015-07-14 10:59:23 -0700308 // CHROMIUM_path_rendering
Brian Salomon2424ec42018-08-24 10:26:42 -0400309 GrGLFunction<GrGLBindFragmentInputLocationFn> fBindFragmentInputLocation;
cdalton626e1ff2015-06-12 13:56:46 -0700310
311 /* NV_framebuffer_mixed_samples */
Brian Salomon2424ec42018-08-24 10:26:42 -0400312 GrGLFunction<GrGLCoverageModulationFn> fCoverageModulation;
cdalton626e1ff2015-06-12 13:56:46 -0700313
jvanverth84741b32016-09-30 08:39:02 -0700314 /* ARB_sync */
Brian Salomon2424ec42018-08-24 10:26:42 -0400315 GrGLFunction<GrGLFenceSyncFn> fFenceSync;
316 GrGLFunction<GrGLIsSyncFn> fIsSync;
317 GrGLFunction<GrGLClientWaitSyncFn> fClientWaitSync;
318 GrGLFunction<GrGLWaitSyncFn> fWaitSync;
319 GrGLFunction<GrGLDeleteSyncFn> fDeleteSync;
jvanverth84741b32016-09-30 08:39:02 -0700320
Greg Daniel81e7bf82017-07-19 14:47:42 -0400321 /* ARB_internalforamt_query */
Brian Salomon2424ec42018-08-24 10:26:42 -0400322 GrGLFunction<GrGLGetInternalformativFn> fGetInternalformativ;
Greg Daniel81e7bf82017-07-19 14:47:42 -0400323
cdalton626e1ff2015-06-12 13:56:46 -0700324 /* KHR_debug */
Brian Salomon2424ec42018-08-24 10:26:42 -0400325 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;
bsalomonb1a32ad2015-11-16 06:48:44 -0800332
csmartdalton9bc11872016-08-09 12:42:47 -0700333 /* EXT_window_rectangles */
Brian Salomon2424ec42018-08-24 10:26:42 -0400334 GrGLFunction<GrGLWindowRectanglesFn> fWindowRectangles;
csmartdalton9bc11872016-08-09 12:42:47 -0700335
bsalomonb1a32ad2015-11-16 06:48:44 -0800336 /* EGL functions */
Brian Salomon2424ec42018-08-24 10:26:42 -0400337 GrGLFunction<GrEGLCreateImageFn> fEGLCreateImage;
338 GrGLFunction<GrEGLDestroyImageFn> fEGLDestroyImage;
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000339 } fFunctions;
340
Robert Phillips752e08b2018-06-22 09:48:38 -0400341#if GR_TEST_UTILS
bsalomon944bcf02014-07-29 08:01:52 -0700342 // This exists for internal testing.
Robert Phillips752e08b2018-06-22 09:48:38 -0400343 virtual void abandon() const;
344#endif
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000345};
twiz@google.com59a190b2011-03-14 21:23:01 +0000346
347#endif