Flutter Engine
The Flutter Engine
Typedefs | Functions
GrGLAssembleInterface.h File Reference
#include "include/gpu/gl/GrGLInterface.h"
#include "include/private/base/SkAPI.h"

Go to the source code of this file.

Typedefs

typedef GrGLFuncPtr(* GrGLGetProc) (void *ctx, const char name[])
 

Functions

SK_API sk_sp< const GrGLInterfaceGrGLMakeAssembledInterface (void *ctx, GrGLGetProc get)
 
SK_API sk_sp< const GrGLInterfaceGrGLMakeAssembledGLInterface (void *ctx, GrGLGetProc get)
 
SK_API sk_sp< const GrGLInterfaceGrGLMakeAssembledGLESInterface (void *ctx, GrGLGetProc get)
 
SK_API sk_sp< const GrGLInterfaceGrGLMakeAssembledWebGLInterface (void *ctx, GrGLGetProc get)
 
SK_API const GrGLInterfaceGrGLAssembleInterface (void *ctx, GrGLGetProc get)
 

Typedef Documentation

◆ GrGLGetProc

typedef GrGLFuncPtr(* GrGLGetProc) (void *ctx, const char name[])

Definition at line 13 of file GrGLAssembleInterface.h.

Function Documentation

◆ GrGLAssembleInterface()

SK_API const GrGLInterface * GrGLAssembleInterface ( void *  ctx,
GrGLGetProc  get 
)

Deprecated version of GrGLMakeAssembledInterface() that returns a bare pointer.

Definition at line 41 of file GrGLAssembleInterface.cpp.

41 {
43}
sk_sp< const GrGLInterface > GrGLMakeAssembledInterface(void *ctx, GrGLGetProc get)
T * release()
Definition: SkRefCnt.h:324
const myers::Point & get(const myers::Segment &)

◆ GrGLMakeAssembledGLESInterface()

SK_API sk_sp< const GrGLInterface > GrGLMakeAssembledGLESInterface ( void *  ctx,
GrGLGetProc  get 
)

Generic function for creating a GrGLInterface for an OpenGL ES (but not Open GL) context. It calls get() to get each function address. ctx is a generic ptr passed to and interpreted by get().

Definition at line 27 of file GrGLAssembleGLESInterfaceAutogen.cpp.

27 {
28 GET_PROC_LOCAL(GetString);
29 if (nullptr == GetString) {
30 return nullptr;
31 }
32
33 const char* verStr = reinterpret_cast<const char*>(GetString(GR_GL_VERSION));
35
36 if (glVer < GR_GL_VER(2,0)) {
37 return nullptr;
38 }
39
40 GET_PROC_LOCAL(GetIntegerv);
41 GET_PROC_LOCAL(GetStringi);
42 GrEGLQueryStringFn* queryString;
43 GrEGLDisplay display;
44 GrGetEGLQueryAndDisplay(&queryString, &display, ctx, get);
46 if (!extensions.init(kGLES_GrGLStandard, GetString, GetStringi, GetIntegerv, queryString,
47 display)) {
48 return nullptr;
49 }
50
52 GrGLInterface::Functions* functions = &interface->fFunctions;
53
54 // Autogenerated content follows
55 GET_PROC(ActiveTexture);
56 GET_PROC(AttachShader);
57 GET_PROC(BindAttribLocation);
58 GET_PROC(BindBuffer);
59 GET_PROC(BindTexture);
60 GET_PROC(BlendColor);
62 GET_PROC(BlendFunc);
63 GET_PROC(BufferData);
64 GET_PROC(BufferSubData);
65 GET_PROC(Clear);
66 GET_PROC(ClearColor);
67 GET_PROC(ClearStencil);
68 GET_PROC(ColorMask);
69 GET_PROC(CompileShader);
70 GET_PROC(CompressedTexImage2D);
71 GET_PROC(CompressedTexSubImage2D);
72 GET_PROC(CopyTexSubImage2D);
73 GET_PROC(CreateProgram);
74 GET_PROC(CreateShader);
75 GET_PROC(CullFace);
76 GET_PROC(DeleteBuffers);
77 GET_PROC(DeleteProgram);
78 GET_PROC(DeleteShader);
79 GET_PROC(DeleteTextures);
80 GET_PROC(DepthMask);
81 GET_PROC(Disable);
82 GET_PROC(DisableVertexAttribArray);
83 GET_PROC(DrawArrays);
84 GET_PROC(DrawElements);
85 GET_PROC(Enable);
86 GET_PROC(EnableVertexAttribArray);
89 GET_PROC(FrontFace);
90 GET_PROC(GenBuffers);
91 GET_PROC(GenTextures);
92 GET_PROC(GetBufferParameteriv);
93 GET_PROC(GetError);
94 GET_PROC(GetFloatv);
95 GET_PROC(GetIntegerv);
96 GET_PROC(GetProgramInfoLog);
97 GET_PROC(GetProgramiv);
99 GET_PROC(GetShaderiv);
100 GET_PROC(GetString);
101 GET_PROC(GetUniformLocation);
102 GET_PROC(IsTexture);
103 GET_PROC(LineWidth);
105 GET_PROC(PixelStorei);
106 GET_PROC(ReadPixels);
107 GET_PROC(Scissor);
108 GET_PROC(ShaderSource);
109 GET_PROC(StencilFunc);
110 GET_PROC(StencilFuncSeparate);
111 GET_PROC(StencilMask);
112 GET_PROC(StencilMaskSeparate);
114 GET_PROC(StencilOpSeparate);
115 GET_PROC(TexImage2D);
116 GET_PROC(TexParameterf);
117 GET_PROC(TexParameterfv);
118 GET_PROC(TexParameteri);
119 GET_PROC(TexParameteriv);
120 GET_PROC(TexSubImage2D);
121 GET_PROC(Uniform1f);
122 GET_PROC(Uniform1fv);
123 GET_PROC(Uniform1i);
124 GET_PROC(Uniform1iv);
125 GET_PROC(Uniform2f);
126 GET_PROC(Uniform2fv);
127 GET_PROC(Uniform2i);
128 GET_PROC(Uniform2iv);
129 GET_PROC(Uniform3f);
130 GET_PROC(Uniform3fv);
131 GET_PROC(Uniform3i);
132 GET_PROC(Uniform3iv);
133 GET_PROC(Uniform4f);
134 GET_PROC(Uniform4fv);
135 GET_PROC(Uniform4i);
136 GET_PROC(Uniform4iv);
137 GET_PROC(UniformMatrix2fv);
138 GET_PROC(UniformMatrix3fv);
139 GET_PROC(UniformMatrix4fv);
140 GET_PROC(UseProgram);
141 GET_PROC(VertexAttrib1f);
142 GET_PROC(VertexAttrib2fv);
143 GET_PROC(VertexAttrib3fv);
144 GET_PROC(VertexAttrib4fv);
145 GET_PROC(VertexAttribPointer);
146 GET_PROC(Viewport);
147
148 if (glVer >= GR_GL_VER(3,0)) {
149 GET_PROC(GetStringi);
150 }
151
152 if (glVer >= GR_GL_VER(3,1)) {
153 GET_PROC(MemoryBarrier);
154 }
155
156 if (glVer >= GR_GL_VER(3,0)) {
157 GET_PROC(BindVertexArray);
158 GET_PROC(DeleteVertexArrays);
159 GET_PROC(GenVertexArrays);
160 } else if (extensions.has("GL_OES_vertex_array_object")) {
161 GET_PROC_SUFFIX(BindVertexArray, OES);
162 GET_PROC_SUFFIX(DeleteVertexArrays, OES);
163 GET_PROC_SUFFIX(GenVertexArrays, OES);
164 }
165
166 if (glVer >= GR_GL_VER(3,2)) {
167 GET_PROC(PatchParameteri);
168 } else if (extensions.has("GL_OES_tessellation_shader")) {
169 GET_PROC_SUFFIX(PatchParameteri, OES);
170 }
171
172 if (glVer >= GR_GL_VER(3,0) && extensions.has("GL_EXT_blend_func_extended")) {
173 GET_PROC_SUFFIX(BindFragDataLocation, EXT);
174 }
175
176 if (glVer >= GR_GL_VER(3,0) && extensions.has("GL_EXT_blend_func_extended")) {
177 GET_PROC_SUFFIX(BindFragDataLocationIndexed, EXT);
178 }
179
180 if (extensions.has("GL_KHR_blend_equation_advanced")) {
181 GET_PROC_SUFFIX(BlendBarrier, KHR);
182 } else if (extensions.has("GL_NV_blend_equation_advanced")) {
183 GET_PROC_SUFFIX(BlendBarrier, NV);
184 }
185
186 if (extensions.has("GL_EXT_clear_texture")) {
187 GET_PROC_SUFFIX(ClearTexImage, EXT);
188 GET_PROC_SUFFIX(ClearTexSubImage, EXT);
189 }
190
191 if (glVer >= GR_GL_VER(3,0)) {
192 GET_PROC(DrawArraysInstanced);
193 GET_PROC(DrawElementsInstanced);
194 } else if (extensions.has("GL_EXT_draw_instanced")) {
195 GET_PROC_SUFFIX(DrawArraysInstanced, EXT);
196 GET_PROC_SUFFIX(DrawElementsInstanced, EXT);
197 } else if (extensions.has("GL_ANGLE_instanced_arrays")) {
198 GET_PROC_SUFFIX(DrawArraysInstanced, ANGLE);
199 GET_PROC_SUFFIX(DrawElementsInstanced, ANGLE);
200 }
201
202 if (extensions.has("GL_EXT_base_instance")) {
203 GET_PROC_SUFFIX(DrawArraysInstancedBaseInstance, EXT);
204 GET_PROC_SUFFIX(DrawElementsInstancedBaseVertexBaseInstance, EXT);
205 } else if (extensions.has("GL_ANGLE_base_vertex_base_instance")) {
206 GET_PROC_SUFFIX(DrawArraysInstancedBaseInstance, ANGLE);
207 GET_PROC_SUFFIX(DrawElementsInstancedBaseVertexBaseInstance, ANGLE);
208 }
209
210 if (glVer >= GR_GL_VER(3,0)) {
211 GET_PROC(DrawBuffers);
212 GET_PROC(ReadBuffer);
213 }
214
215 if (glVer >= GR_GL_VER(3,1)) {
216 GET_PROC(DrawArraysIndirect);
217 GET_PROC(DrawElementsIndirect);
218 }
219
220 if (extensions.has("GL_ANGLE_base_vertex_base_instance")) {
221 GET_PROC_SUFFIX(MultiDrawArraysInstancedBaseInstance, ANGLE);
222 GET_PROC_SUFFIX(MultiDrawElementsInstancedBaseVertexBaseInstance, ANGLE);
223 }
224
225 if (glVer >= GR_GL_VER(3,0)) {
226 GET_PROC(DrawRangeElements);
227 }
228
229 if (glVer >= GR_GL_VER(3,1)) {
230 GET_PROC(GetMultisamplefv);
231 }
232
233 if (glVer >= GR_GL_VER(3,1)) {
234 GET_PROC(GetTexLevelParameteriv);
235 }
236
237 if (extensions.has("GL_EXT_multi_draw_indirect")) {
238 GET_PROC_SUFFIX(MultiDrawArraysIndirect, EXT);
239 GET_PROC_SUFFIX(MultiDrawElementsIndirect, EXT);
240 }
241
242 if (glVer >= GR_GL_VER(3,2)) {
243 GET_PROC(TexBuffer);
244 } else if (extensions.has("GL_OES_texture_buffer")) {
245 GET_PROC_SUFFIX(TexBuffer, OES);
246 } else if (extensions.has("GL_EXT_texture_buffer")) {
247 GET_PROC_SUFFIX(TexBuffer, EXT);
248 }
249
250 if (glVer >= GR_GL_VER(3,2)) {
251 GET_PROC(TexBufferRange);
252 } else if (extensions.has("GL_OES_texture_buffer")) {
253 GET_PROC_SUFFIX(TexBufferRange, OES);
254 } else if (extensions.has("GL_EXT_texture_buffer")) {
255 GET_PROC_SUFFIX(TexBufferRange, EXT);
256 }
257
258 if (glVer >= GR_GL_VER(3,0)) {
259 GET_PROC(TexStorage2D);
260 } else if (extensions.has("GL_EXT_texture_storage")) {
261 GET_PROC_SUFFIX(TexStorage2D, EXT);
262 }
263
264 if (extensions.has("GL_NV_texture_barrier")) {
265 GET_PROC_SUFFIX(TextureBarrier, NV);
266 }
267
268 if (extensions.has("GL_EXT_discard_framebuffer")) {
269 GET_PROC_SUFFIX(DiscardFramebuffer, EXT);
270 }
271
272 if (extensions.has("GL_QCOM_tiled_rendering")) {
273 GET_PROC_SUFFIX(EndTiling, QCOM);
274 GET_PROC_SUFFIX(StartTiling, QCOM);
275 }
276
277 if (glVer >= GR_GL_VER(3,0)) {
278 GET_PROC(VertexAttribDivisor);
279 } else if (extensions.has("GL_EXT_instanced_arrays")) {
280 GET_PROC_SUFFIX(VertexAttribDivisor, EXT);
281 } else if (extensions.has("GL_ANGLE_instanced_arrays")) {
282 GET_PROC_SUFFIX(VertexAttribDivisor, ANGLE);
283 }
284
285 if (glVer >= GR_GL_VER(3,0)) {
286 GET_PROC(VertexAttribIPointer);
287 }
288
289 GET_PROC(BindFramebuffer);
290 GET_PROC(BindRenderbuffer);
291 GET_PROC(CheckFramebufferStatus);
292 GET_PROC(DeleteFramebuffers);
293 GET_PROC(DeleteRenderbuffers);
294 GET_PROC(FramebufferRenderbuffer);
295 GET_PROC(FramebufferTexture2D);
296 GET_PROC(GenFramebuffers);
297 GET_PROC(GenRenderbuffers);
298 GET_PROC(GenerateMipmap);
299 GET_PROC(GetFramebufferAttachmentParameteriv);
300 GET_PROC(GetRenderbufferParameteriv);
301 GET_PROC(RenderbufferStorage);
302
303 if (glVer >= GR_GL_VER(3,0)) {
304 GET_PROC(BlitFramebuffer);
305 } else if (extensions.has("GL_NV_framebuffer_blit")) {
306 GET_PROC_SUFFIX(BlitFramebuffer, NV);
307 } else if (extensions.has("GL_CHROMIUM_framebuffer_multisample")) {
308 GET_PROC_SUFFIX(BlitFramebuffer, CHROMIUM);
309 } else if (extensions.has("GL_ANGLE_framebuffer_blit")) {
310 GET_PROC_SUFFIX(BlitFramebuffer, ANGLE);
311 }
312
313 if (glVer >= GR_GL_VER(3,0)) {
314 GET_PROC(RenderbufferStorageMultisample);
315 } else if (extensions.has("GL_CHROMIUM_framebuffer_multisample")) {
316 GET_PROC_SUFFIX(RenderbufferStorageMultisample, CHROMIUM);
317 } else if (extensions.has("GL_ANGLE_framebuffer_multisample")) {
318 GET_PROC_SUFFIX(RenderbufferStorageMultisample, ANGLE);
319 }
320
321 if (extensions.has("GL_CHROMIUM_map_sub")) {
322 GET_PROC_SUFFIX(MapBufferSubData, CHROMIUM);
323 GET_PROC_SUFFIX(MapTexSubImage2D, CHROMIUM);
324 GET_PROC_SUFFIX(UnmapBufferSubData, CHROMIUM);
325 GET_PROC_SUFFIX(UnmapTexSubImage2D, CHROMIUM);
326 }
327
328 if (extensions.has("GL_EXT_multisampled_render_to_texture")) {
329 GET_PROC_SUFFIX(FramebufferTexture2DMultisample, EXT);
330 } else if (extensions.has("GL_IMG_multisampled_render_to_texture")) {
331 GET_PROC_SUFFIX(FramebufferTexture2DMultisample, IMG);
332 }
333
334 if (extensions.has("GL_EXT_multisampled_render_to_texture")) {
335 functions->fRenderbufferStorageMultisampleES2EXT =(GrGLRenderbufferStorageMultisampleFn*)get(ctx, "glRenderbufferStorageMultisampleEXT");
336 }
337
338 if (extensions.has("GL_IMG_multisampled_render_to_texture")) {
339 functions->fRenderbufferStorageMultisampleES2EXT =(GrGLRenderbufferStorageMultisampleFn*)get(ctx, "glRenderbufferStorageMultisampleIMG");
340 }
341
342 if (extensions.has("GL_APPLE_framebuffer_multisample")) {
343 GET_PROC_SUFFIX(ResolveMultisampleFramebuffer, APPLE);
344 functions->fRenderbufferStorageMultisampleES2APPLE =(GrGLRenderbufferStorageMultisampleFn*)get(ctx, "glRenderbufferStorageMultisampleAPPLE");
345 }
346
347 if (extensions.has("GL_OES_mapbuffer")) {
348 GET_PROC_SUFFIX(MapBuffer, OES);
349 }
350
351 if (glVer >= GR_GL_VER(3,0)) {
352 GET_PROC(UnmapBuffer);
353 } else if (extensions.has("GL_OES_mapbuffer")) {
354 GET_PROC_SUFFIX(UnmapBuffer, OES);
355 }
356
357 if (glVer >= GR_GL_VER(3,0)) {
358 GET_PROC(FlushMappedBufferRange);
359 GET_PROC(MapBufferRange);
360 } else if (extensions.has("GL_EXT_map_buffer_range")) {
361 GET_PROC_SUFFIX(FlushMappedBufferRange, EXT);
362 GET_PROC_SUFFIX(MapBufferRange, EXT);
363 }
364
365 if (extensions.has("GL_EXT_debug_marker")) {
366 GET_PROC_SUFFIX(InsertEventMarker, EXT);
367 GET_PROC_SUFFIX(PopGroupMarker, EXT);
368 GET_PROC_SUFFIX(PushGroupMarker, EXT);
369 }
370
371 if (glVer >= GR_GL_VER(3,0)) {
372 GET_PROC(CopyBufferSubData);
373 } else if (extensions.has("GL_NV_copy_buffer")) {
374 GET_PROC_SUFFIX(CopyBufferSubData, NV);
375 }
376
377 if (extensions.has("GL_KHR_debug")) {
378 GET_PROC_SUFFIX(DebugMessageCallback, KHR);
379 GET_PROC_SUFFIX(DebugMessageControl, KHR);
380 GET_PROC_SUFFIX(DebugMessageInsert, KHR);
381 GET_PROC_SUFFIX(GetDebugMessageLog, KHR);
382 GET_PROC_SUFFIX(ObjectLabel, KHR);
383 GET_PROC_SUFFIX(PopDebugGroup, KHR);
384 GET_PROC_SUFFIX(PushDebugGroup, KHR);
385 }
386
387 if (extensions.has("GL_CHROMIUM_bind_uniform_location")) {
388 GET_PROC_SUFFIX(BindUniformLocation, CHROMIUM);
389 }
390
391 if (extensions.has("GL_EXT_window_rectangles")) {
392 GET_PROC_SUFFIX(WindowRectangles, EXT);
393 }
394
395 if (glVer >= GR_GL_VER(3,0)) {
396 GET_PROC(ClientWaitSync);
397 GET_PROC(DeleteSync);
398 GET_PROC(FenceSync);
399 GET_PROC(IsSync);
400 GET_PROC(WaitSync);
401 } else if (extensions.has("GL_APPLE_sync")) {
402 GET_PROC_SUFFIX(ClientWaitSync, APPLE);
403 GET_PROC_SUFFIX(DeleteSync, APPLE);
404 GET_PROC_SUFFIX(FenceSync, APPLE);
405 GET_PROC_SUFFIX(IsSync, APPLE);
406 GET_PROC_SUFFIX(WaitSync, APPLE);
407 }
408
409 if (glVer >= GR_GL_VER(3,0)) {
410 GET_PROC(GetInternalformativ);
411 }
412
413 if (glVer >= GR_GL_VER(3,0)) {
414 GET_PROC(GetProgramBinary);
415 GET_PROC(ProgramBinary);
416 } else if (extensions.has("GL_OES_get_program_binary")) {
417 GET_PROC_SUFFIX(GetProgramBinary, OES);
418 GET_PROC_SUFFIX(ProgramBinary, OES);
419 }
420
421 if (glVer >= GR_GL_VER(3,0)) {
422 GET_PROC(ProgramParameteri);
423 }
424
425 if (glVer >= GR_GL_VER(3,0)) {
426 GET_PROC(BindSampler);
427 GET_PROC(DeleteSamplers);
428 GET_PROC(GenSamplers);
429 GET_PROC(SamplerParameterf);
430 GET_PROC(SamplerParameteri);
431 GET_PROC(SamplerParameteriv);
432 }
433
434 if (glVer >= GR_GL_VER(3,0)) {
435#if defined(GR_TEST_UTILS)
436 GET_PROC(BeginQuery);
437 GET_PROC(DeleteQueries);
438 GET_PROC(EndQuery);
439 GET_PROC(GenQueries);
440 GET_PROC(GetQueryObjectuiv);
441 GET_PROC(GetQueryiv);
442#endif
443 } else if (extensions.has("GL_EXT_occlusion_query_boolean")) {
444#if defined(GR_TEST_UTILS)
445 GET_PROC_SUFFIX(BeginQuery, EXT);
446 GET_PROC_SUFFIX(DeleteQueries, EXT);
447 GET_PROC_SUFFIX(EndQuery, EXT);
448 GET_PROC_SUFFIX(GenQueries, EXT);
449 GET_PROC_SUFFIX(GetQueryObjectuiv, EXT);
450 GET_PROC_SUFFIX(GetQueryiv, EXT);
451#endif
452 }
453
454 if (extensions.has("GL_ARB_invalidate_subdata")) {
455 GET_PROC(InvalidateBufferData);
456 GET_PROC(InvalidateBufferSubData);
457 GET_PROC(InvalidateTexImage);
458 GET_PROC(InvalidateTexSubImage);
459 }
460
461 if (glVer >= GR_GL_VER(3,0)) {
462 GET_PROC(InvalidateFramebuffer);
463 GET_PROC(InvalidateSubFramebuffer);
464 } else if (extensions.has("GL_ARB_invalidate_subdata")) {
465 GET_PROC(InvalidateFramebuffer);
466 GET_PROC(InvalidateSubFramebuffer);
467 }
468
469 GET_PROC(GetShaderPrecisionFormat);
470
471 if (extensions.has("GL_NV_fence")) {
472 GET_PROC_SUFFIX(DeleteFences, NV);
473 GET_PROC_SUFFIX(FinishFence, NV);
474 GET_PROC_SUFFIX(GenFences, NV);
475 GET_PROC_SUFFIX(SetFence, NV);
476 GET_PROC_SUFFIX(TestFence, NV);
477 }
478
479
480 // End autogenerated content
481 // TODO(kjlubick): Do we want a feature that removes the extension if it doesn't have
482 // the function? This is common on some low-end GPUs.
483
484 if (extensions.has("GL_KHR_debug")) {
485 // In general we have a policy against removing extension strings when the driver does
486 // not provide function pointers for an advertised extension. However, because there is a
487 // known device that advertises GL_KHR_debug but fails to provide the functions and this is
488 // a debugging- only extension we've made an exception. This also can happen when using
489 // APITRACE.
490 if (!interface->fFunctions.fDebugMessageControl) {
491 extensions.remove("GL_KHR_debug");
492 }
493 }
494 interface->fStandard = kGLES_GrGLStandard;
495 interface->fExtensions.swap(&extensions);
496
497 return interface;
498}
#define GET_PROC_SUFFIX(F, S)
#define GET_PROC_LOCAL(F)
void GrGetEGLQueryAndDisplay(GrEGLQueryStringFn **queryString, GrEGLDisplay *display, void *ctx, GrGLGetProc get)
#define GR_GL_VERSION
Definition: GrGLDefines.h:602
GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLsizei samples, GrGLenum internalformat, GrGLsizei width, GrGLsizei height) GrGLRenderbufferStorageMultisampleFn
const char *GR_GL_FUNCTION_TYPE(GrEGLDisplay dpy, GrEGLint name) GrEGLQueryStringFn
@ kGLES_GrGLStandard
Definition: GrGLTypes.h:22
void * GrEGLDisplay
Definition: GrGLTypes.h:166
GrGLVersion GrGLGetVersionFromString(const char *versionString)
Definition: GrGLUtil.cpp:68
#define GR_GL_VER(major, minor)
Definition: GrGLUtil.h:26
uint32_t GrGLVersion
Definition: GrGLUtil.h:22
static void Finish(Thread *thread)
Definition: bootstrap.cc:44
static std::string GetShaderInfoLog(const ProcTableGLES &gl, GLuint shader)
static bool LinkProgram(const ReactorGLES &reactor, const std::shared_ptr< PipelineGLES > &pipeline, const std::shared_ptr< const ShaderFunction > &vert_function, const std::shared_ptr< const ShaderFunction > &frag_function)
string CHROMIUM
Definition: scan_deps.py:28
BlendEquation
Definition: Blend.h:26
void Flush(SkSurface *surface)
Definition: GpuTools.h:25
GrGLFunction< GrGLRenderbufferStorageMultisampleFn > fRenderbufferStorageMultisampleES2EXT
GrGLFunction< GrGLRenderbufferStorageMultisampleFn > fRenderbufferStorageMultisampleES2APPLE

◆ GrGLMakeAssembledGLInterface()

SK_API sk_sp< const GrGLInterface > GrGLMakeAssembledGLInterface ( void *  ctx,
GrGLGetProc  get 
)

Generic function for creating a GrGLInterface for an OpenGL (but not GLES) context. It calls get() to get each function address. ctx is a generic ptr passed to and interpreted by get().

Definition at line 27 of file GrGLAssembleGLInterfaceAutogen.cpp.

27 {
28 GET_PROC_LOCAL(GetString);
29 GET_PROC_LOCAL(GetStringi);
30 GET_PROC_LOCAL(GetIntegerv);
31
32 // GetStringi may be nullptr depending on the GL version.
33 if (nullptr == GetString || nullptr == GetIntegerv) {
34 return nullptr;
35 }
36
37 const char* versionString = (const char*) GetString(GR_GL_VERSION);
38 GrGLVersion glVer = GrGLGetVersionFromString(versionString);
39
40 if (glVer < GR_GL_VER(2,0) || GR_GL_INVALID_VER == glVer) {
41 // This is our minimum for non-ES GL.
42 return nullptr;
43 }
44
45 GrEGLQueryStringFn* queryString;
46 GrEGLDisplay display;
47 GrGetEGLQueryAndDisplay(&queryString, &display, ctx, get);
49 if (!extensions.init(kGL_GrGLStandard, GetString, GetStringi, GetIntegerv, queryString,
50 display)) {
51 return nullptr;
52 }
53
54 sk_sp<GrGLInterface> interface(new GrGLInterface());
55 GrGLInterface::Functions* functions = &interface->fFunctions;
56
57 // Autogenerated content follows
58 GET_PROC(ActiveTexture);
59 GET_PROC(AttachShader);
60 GET_PROC(BindAttribLocation);
61 GET_PROC(BindBuffer);
62 GET_PROC(BindTexture);
63 GET_PROC(BlendColor);
65 GET_PROC(BlendFunc);
66 GET_PROC(BufferData);
67 GET_PROC(BufferSubData);
68 GET_PROC(Clear);
69 GET_PROC(ClearColor);
70 GET_PROC(ClearStencil);
71 GET_PROC(ColorMask);
72 GET_PROC(CompileShader);
73 GET_PROC(CompressedTexImage2D);
74 GET_PROC(CompressedTexSubImage2D);
75 GET_PROC(CopyTexSubImage2D);
76 GET_PROC(CreateProgram);
77 GET_PROC(CreateShader);
78 GET_PROC(CullFace);
79 GET_PROC(DeleteBuffers);
80 GET_PROC(DeleteProgram);
81 GET_PROC(DeleteShader);
82 GET_PROC(DeleteTextures);
83 GET_PROC(DepthMask);
84 GET_PROC(Disable);
85 GET_PROC(DisableVertexAttribArray);
86 GET_PROC(DrawArrays);
87 GET_PROC(DrawElements);
88 GET_PROC(Enable);
89 GET_PROC(EnableVertexAttribArray);
92 GET_PROC(FrontFace);
93 GET_PROC(GenBuffers);
94 GET_PROC(GenTextures);
95 GET_PROC(GetBufferParameteriv);
96 GET_PROC(GetError);
97 GET_PROC(GetFloatv);
98 GET_PROC(GetIntegerv);
99 GET_PROC(GetProgramInfoLog);
100 GET_PROC(GetProgramiv);
102 GET_PROC(GetShaderiv);
103 GET_PROC(GetString);
104 GET_PROC(GetUniformLocation);
105 GET_PROC(IsTexture);
106 GET_PROC(LineWidth);
108 GET_PROC(PixelStorei);
109 GET_PROC(ReadPixels);
110 GET_PROC(Scissor);
111 GET_PROC(ShaderSource);
112 GET_PROC(StencilFunc);
113 GET_PROC(StencilFuncSeparate);
114 GET_PROC(StencilMask);
115 GET_PROC(StencilMaskSeparate);
117 GET_PROC(StencilOpSeparate);
118 GET_PROC(TexImage2D);
119 GET_PROC(TexParameterf);
120 GET_PROC(TexParameterfv);
121 GET_PROC(TexParameteri);
122 GET_PROC(TexParameteriv);
123 GET_PROC(TexSubImage2D);
124 GET_PROC(Uniform1f);
125 GET_PROC(Uniform1fv);
126 GET_PROC(Uniform1i);
127 GET_PROC(Uniform1iv);
128 GET_PROC(Uniform2f);
129 GET_PROC(Uniform2fv);
130 GET_PROC(Uniform2i);
131 GET_PROC(Uniform2iv);
132 GET_PROC(Uniform3f);
133 GET_PROC(Uniform3fv);
134 GET_PROC(Uniform3i);
135 GET_PROC(Uniform3iv);
136 GET_PROC(Uniform4f);
137 GET_PROC(Uniform4fv);
138 GET_PROC(Uniform4i);
139 GET_PROC(Uniform4iv);
140 GET_PROC(UniformMatrix2fv);
141 GET_PROC(UniformMatrix3fv);
142 GET_PROC(UniformMatrix4fv);
143 GET_PROC(UseProgram);
144 GET_PROC(VertexAttrib1f);
145 GET_PROC(VertexAttrib2fv);
146 GET_PROC(VertexAttrib3fv);
147 GET_PROC(VertexAttrib4fv);
148 GET_PROC(VertexAttribPointer);
149 GET_PROC(Viewport);
150
151 GET_PROC(DrawBuffer);
153
154 if (glVer >= GR_GL_VER(3,0)) {
155 GET_PROC(GetStringi);
156 }
157
158 if (glVer >= GR_GL_VER(4,2)) {
159 GET_PROC(MemoryBarrier);
160 }
161
162 if (glVer >= GR_GL_VER(3,0)) {
163 GET_PROC(BindVertexArray);
164 GET_PROC(DeleteVertexArrays);
165 GET_PROC(GenVertexArrays);
166 } else if (extensions.has("GL_ARB_vertex_array_object")) {
167 GET_PROC(BindVertexArray);
168 GET_PROC(DeleteVertexArrays);
169 GET_PROC(GenVertexArrays);
170 } else if (extensions.has("GL_APPLE_vertex_array_object")) {
171 GET_PROC_SUFFIX(BindVertexArray, APPLE);
172 GET_PROC_SUFFIX(DeleteVertexArrays, APPLE);
173 GET_PROC_SUFFIX(GenVertexArrays, APPLE);
174 }
175
176 if (glVer >= GR_GL_VER(4,0)) {
177 GET_PROC(PatchParameteri);
178 } else if (extensions.has("GL_ARB_tessellation_shader")) {
179 GET_PROC(PatchParameteri);
180 }
181
182 if (glVer >= GR_GL_VER(3,0)) {
183 GET_PROC(BindFragDataLocation);
184 }
185
186 if (glVer >= GR_GL_VER(3,3)) {
187 GET_PROC(BindFragDataLocationIndexed);
188 } else if (extensions.has("GL_ARB_blend_func_extended")) {
189 GET_PROC(BindFragDataLocationIndexed);
190 }
191
192 if (extensions.has("GL_KHR_blend_equation_advanced")) {
193 GET_PROC_SUFFIX(BlendBarrier, KHR);
194 } else if (extensions.has("GL_NV_blend_equation_advanced")) {
195 GET_PROC_SUFFIX(BlendBarrier, NV);
196 }
197
198 if (glVer >= GR_GL_VER(4,4)) {
199 GET_PROC(ClearTexImage);
200 GET_PROC(ClearTexSubImage);
201 } else if (extensions.has("GL_ARB_clear_texture")) {
202 GET_PROC(ClearTexImage);
203 GET_PROC(ClearTexSubImage);
204 }
205
206 if (glVer >= GR_GL_VER(3,1)) {
207 GET_PROC(DrawArraysInstanced);
208 GET_PROC(DrawElementsInstanced);
209 } else if (extensions.has("GL_ARB_draw_instanced")) {
210 GET_PROC(DrawArraysInstanced);
211 GET_PROC(DrawElementsInstanced);
212 } else if (extensions.has("GL_EXT_draw_instanced")) {
213 GET_PROC_SUFFIX(DrawArraysInstanced, EXT);
214 GET_PROC_SUFFIX(DrawElementsInstanced, EXT);
215 }
216
217 if (glVer >= GR_GL_VER(4,2)) {
218 GET_PROC(DrawArraysInstancedBaseInstance);
219 GET_PROC(DrawElementsInstancedBaseVertexBaseInstance);
220 } else if (extensions.has("GL_ARB_base_instance")) {
221 GET_PROC(DrawArraysInstancedBaseInstance);
222 GET_PROC(DrawElementsInstancedBaseVertexBaseInstance);
223 }
224
225 GET_PROC(DrawBuffers);
226 GET_PROC(ReadBuffer);
227
228 if (glVer >= GR_GL_VER(4,0)) {
229 GET_PROC(DrawArraysIndirect);
230 GET_PROC(DrawElementsIndirect);
231 } else if (extensions.has("GL_ARB_draw_indirect")) {
232 GET_PROC(DrawArraysIndirect);
233 GET_PROC(DrawElementsIndirect);
234 }
235
236 GET_PROC(DrawRangeElements);
237
238 if (glVer >= GR_GL_VER(3,2)) {
239 GET_PROC(GetMultisamplefv);
240 } else if (extensions.has("GL_ARB_texture_multisample")) {
241 GET_PROC(GetMultisamplefv);
242 }
243
244 GET_PROC(GetTexLevelParameteriv);
245
246 if (glVer >= GR_GL_VER(4,3)) {
247 GET_PROC(MultiDrawArraysIndirect);
248 GET_PROC(MultiDrawElementsIndirect);
249 } else if (extensions.has("GL_ARB_multi_draw_indirect")) {
250 GET_PROC(MultiDrawArraysIndirect);
251 GET_PROC(MultiDrawElementsIndirect);
252 }
253
254 if (glVer >= GR_GL_VER(3,1)) {
255 GET_PROC(TexBuffer);
256 }
257
258 if (glVer >= GR_GL_VER(4,3)) {
259 GET_PROC(TexBufferRange);
260 }
261
262 if (glVer >= GR_GL_VER(4,2)) {
263 GET_PROC(TexStorage2D);
264 } else if (extensions.has("GL_ARB_texture_storage")) {
265 GET_PROC(TexStorage2D);
266 } else if (extensions.has("GL_EXT_texture_storage")) {
267 GET_PROC_SUFFIX(TexStorage2D, EXT);
268 }
269
270 if (glVer >= GR_GL_VER(4,5)) {
271 GET_PROC(TextureBarrier);
272 } else if (extensions.has("GL_ARB_texture_barrier")) {
273 GET_PROC(TextureBarrier);
274 } else if (extensions.has("GL_NV_texture_barrier")) {
275 GET_PROC_SUFFIX(TextureBarrier, NV);
276 }
277
278 if (glVer >= GR_GL_VER(3,2)) {
279 GET_PROC(VertexAttribDivisor);
280 } else if (extensions.has("GL_ARB_instanced_arrays")) {
281 GET_PROC(VertexAttribDivisor);
282 }
283
284 if (glVer >= GR_GL_VER(3,0)) {
285 GET_PROC(VertexAttribIPointer);
286 }
287
288 if (glVer >= GR_GL_VER(3,0)) {
289 GET_PROC(BindFramebuffer);
290 GET_PROC(BindRenderbuffer);
291 GET_PROC(CheckFramebufferStatus);
292 GET_PROC(DeleteFramebuffers);
293 GET_PROC(DeleteRenderbuffers);
294 GET_PROC(FramebufferRenderbuffer);
295 GET_PROC(FramebufferTexture2D);
296 GET_PROC(GenFramebuffers);
297 GET_PROC(GenRenderbuffers);
298 GET_PROC(GenerateMipmap);
299 GET_PROC(GetFramebufferAttachmentParameteriv);
300 GET_PROC(GetRenderbufferParameteriv);
301 GET_PROC(RenderbufferStorage);
302 } else if (extensions.has("GL_ARB_framebuffer_object")) {
303 GET_PROC(BindFramebuffer);
304 GET_PROC(BindRenderbuffer);
305 GET_PROC(CheckFramebufferStatus);
306 GET_PROC(DeleteFramebuffers);
307 GET_PROC(DeleteRenderbuffers);
308 GET_PROC(FramebufferRenderbuffer);
309 GET_PROC(FramebufferTexture2D);
310 GET_PROC(GenFramebuffers);
311 GET_PROC(GenRenderbuffers);
312 GET_PROC(GenerateMipmap);
313 GET_PROC(GetFramebufferAttachmentParameteriv);
314 GET_PROC(GetRenderbufferParameteriv);
315 GET_PROC(RenderbufferStorage);
316 } else if (extensions.has("GL_EXT_framebuffer_object")) {
317 GET_PROC_SUFFIX(BindFramebuffer, EXT);
318 GET_PROC_SUFFIX(BindRenderbuffer, EXT);
319 GET_PROC_SUFFIX(CheckFramebufferStatus, EXT);
320 GET_PROC_SUFFIX(DeleteFramebuffers, EXT);
321 GET_PROC_SUFFIX(DeleteRenderbuffers, EXT);
322 GET_PROC_SUFFIX(FramebufferRenderbuffer, EXT);
323 GET_PROC_SUFFIX(FramebufferTexture2D, EXT);
324 GET_PROC_SUFFIX(GenFramebuffers, EXT);
325 GET_PROC_SUFFIX(GenRenderbuffers, EXT);
326 GET_PROC_SUFFIX(GenerateMipmap, EXT);
327 GET_PROC_SUFFIX(GetFramebufferAttachmentParameteriv, EXT);
328 GET_PROC_SUFFIX(GetRenderbufferParameteriv, EXT);
329 GET_PROC_SUFFIX(RenderbufferStorage, EXT);
330 }
331
332 if (glVer >= GR_GL_VER(3,0)) {
333 GET_PROC(BlitFramebuffer);
334 } else if (extensions.has("GL_ARB_framebuffer_object")) {
335 GET_PROC(BlitFramebuffer);
336 } else if (extensions.has("GL_EXT_framebuffer_blit")) {
337 GET_PROC_SUFFIX(BlitFramebuffer, EXT);
338 }
339
340 if (glVer >= GR_GL_VER(3,0)) {
341 GET_PROC(RenderbufferStorageMultisample);
342 } else if (extensions.has("GL_ARB_framebuffer_object")) {
343 GET_PROC(RenderbufferStorageMultisample);
344 } else if (extensions.has("GL_EXT_framebuffer_multisample")) {
345 GET_PROC_SUFFIX(RenderbufferStorageMultisample, EXT);
346 }
347
348 GET_PROC(MapBuffer);
349
350 GET_PROC(UnmapBuffer);
351
352 if (glVer >= GR_GL_VER(3,0)) {
353 GET_PROC(FlushMappedBufferRange);
354 GET_PROC(MapBufferRange);
355 } else if (extensions.has("GL_ARB_map_buffer_range")) {
356 GET_PROC(FlushMappedBufferRange);
357 GET_PROC(MapBufferRange);
358 }
359
360 if (extensions.has("GL_EXT_debug_marker")) {
361 GET_PROC_SUFFIX(InsertEventMarker, EXT);
362 GET_PROC_SUFFIX(PopGroupMarker, EXT);
363 GET_PROC_SUFFIX(PushGroupMarker, EXT);
364 }
365
366 if (glVer >= GR_GL_VER(3,1)) {
367 GET_PROC(CopyBufferSubData);
368 } else if (extensions.has("GL_ARB_copy_buffer")) {
369 GET_PROC(CopyBufferSubData);
370 }
371
372 if (glVer >= GR_GL_VER(4,3)) {
373 GET_PROC(DebugMessageCallback);
374 GET_PROC(DebugMessageControl);
375 GET_PROC(DebugMessageInsert);
376 GET_PROC(GetDebugMessageLog);
377 GET_PROC(ObjectLabel);
378 GET_PROC(PopDebugGroup);
379 GET_PROC(PushDebugGroup);
380 } else if (extensions.has("GL_KHR_debug")) {
381 GET_PROC(DebugMessageCallback);
382 GET_PROC(DebugMessageControl);
383 GET_PROC(DebugMessageInsert);
384 GET_PROC(GetDebugMessageLog);
385 GET_PROC(ObjectLabel);
386 GET_PROC(PopDebugGroup);
387 GET_PROC(PushDebugGroup);
388 }
389
390 if (extensions.has("GL_EXT_window_rectangles")) {
391 GET_PROC_SUFFIX(WindowRectangles, EXT);
392 }
393
394 if (glVer >= GR_GL_VER(3,2)) {
395 GET_PROC(ClientWaitSync);
396 GET_PROC(DeleteSync);
397 GET_PROC(FenceSync);
398 GET_PROC(IsSync);
399 GET_PROC(WaitSync);
400 } else if (extensions.has("GL_ARB_sync")) {
401 GET_PROC(ClientWaitSync);
402 GET_PROC(DeleteSync);
403 GET_PROC(FenceSync);
404 GET_PROC(IsSync);
405 GET_PROC(WaitSync);
406 }
407
408 if (glVer >= GR_GL_VER(4,2)) {
409 GET_PROC(GetInternalformativ);
410 } else if (extensions.has("GL_ARB_internalformat_query")) {
411 GET_PROC(GetInternalformativ);
412 }
413
414 if (glVer >= GR_GL_VER(4,1)) {
415 GET_PROC(GetProgramBinary);
416 GET_PROC(ProgramBinary);
417 }
418
419 if (glVer >= GR_GL_VER(4,1)) {
420 GET_PROC(ProgramParameteri);
421 }
422
423 if (glVer >= GR_GL_VER(3,2)) {
424 GET_PROC(BindSampler);
425 GET_PROC(DeleteSamplers);
426 GET_PROC(GenSamplers);
427 GET_PROC(SamplerParameterf);
428 GET_PROC(SamplerParameteri);
429 GET_PROC(SamplerParameteriv);
430 } else if (extensions.has("GL_ARB_sampler_objects")) {
431 GET_PROC(BindSampler);
432 GET_PROC(DeleteSamplers);
433 GET_PROC(GenSamplers);
434 GET_PROC(SamplerParameterf);
435 GET_PROC(SamplerParameteri);
436 GET_PROC(SamplerParameteriv);
437 }
438
439 GET_PROC(GetQueryObjectiv);
440
441#if defined(GR_TEST_UTILS)
442 GET_PROC(BeginQuery);
443 GET_PROC(DeleteQueries);
444 GET_PROC(EndQuery);
445 GET_PROC(GenQueries);
446 GET_PROC(GetQueryObjectuiv);
447 GET_PROC(GetQueryiv);
448#endif
449
450 if (glVer >= GR_GL_VER(3,3)) {
451 GET_PROC(GetQueryObjecti64v);
452 GET_PROC(GetQueryObjectui64v);
453 } else if (extensions.has("GL_ARB_timer_query")) {
454 GET_PROC(GetQueryObjecti64v);
455 GET_PROC(GetQueryObjectui64v);
456 } else if (extensions.has("GL_EXT_timer_query")) {
457 GET_PROC_SUFFIX(GetQueryObjecti64v, EXT);
458 GET_PROC_SUFFIX(GetQueryObjectui64v, EXT);
459 }
460
461 if (glVer >= GR_GL_VER(3,3)) {
462 GET_PROC(QueryCounter);
463 } else if (extensions.has("GL_ARB_timer_query")) {
464 GET_PROC(QueryCounter);
465 }
466
467 if (glVer >= GR_GL_VER(4,3)) {
468 GET_PROC(InvalidateBufferData);
469 GET_PROC(InvalidateBufferSubData);
470 GET_PROC(InvalidateTexImage);
471 GET_PROC(InvalidateTexSubImage);
472 } else if (extensions.has("GL_ARB_invalidate_subdata")) {
473 GET_PROC(InvalidateBufferData);
474 GET_PROC(InvalidateBufferSubData);
475 GET_PROC(InvalidateTexImage);
476 GET_PROC(InvalidateTexSubImage);
477 }
478
479 if (glVer >= GR_GL_VER(4,3)) {
480 GET_PROC(InvalidateFramebuffer);
481 GET_PROC(InvalidateSubFramebuffer);
482 } else if (extensions.has("GL_ARB_invalidate_subdata")) {
483 GET_PROC(InvalidateFramebuffer);
484 GET_PROC(InvalidateSubFramebuffer);
485 }
486
487 if (glVer >= GR_GL_VER(4,3)) {
488 GET_PROC(GetShaderPrecisionFormat);
489 } else if (extensions.has("GL_ARB_ES2_compatibility")) {
490 GET_PROC(GetShaderPrecisionFormat);
491 }
492
493 if (extensions.has("GL_NV_fence")) {
494 GET_PROC_SUFFIX(DeleteFences, NV);
495 GET_PROC_SUFFIX(FinishFence, NV);
496 GET_PROC_SUFFIX(GenFences, NV);
497 GET_PROC_SUFFIX(SetFence, NV);
498 GET_PROC_SUFFIX(TestFence, NV);
499 }
500
501
502 // End autogenerated content
503 interface->fStandard = kGL_GrGLStandard;
504 interface->fExtensions.swap(&extensions);
505
506 return interface;
507}
#define GET_PROC_SUFFIX(F, S)
#define GET_PROC_LOCAL(F)
#define GET_PROC(F)
@ kGL_GrGLStandard
Definition: GrGLTypes.h:21
#define GR_GL_INVALID_VER
Definition: GrGLUtil.h:37
PolygonMode
Definition: formats.h:383

◆ GrGLMakeAssembledInterface()

SK_API sk_sp< const GrGLInterface > GrGLMakeAssembledInterface ( void *  ctx,
GrGLGetProc  get 
)

Generic function for creating a GrGLInterface for an either OpenGL or GLES. It calls get() to get each function address. ctx is a generic ptr passed to and interpreted by get().

Definition at line 16 of file GrGLAssembleInterface.cpp.

16 {
17 GET_PROC_LOCAL(GetString);
18 if (nullptr == GetString) {
19 return nullptr;
20 }
21
22 const char* verStr = reinterpret_cast<const char*>(GetString(GR_GL_VERSION));
23 if (nullptr == verStr) {
24 return nullptr;
25 }
26
28 // standard can be unused (optimized away) if SK_ASSUME_GL_ES is set
30
31 if (GR_IS_GR_GL_ES(standard)) {
33 } else if (GR_IS_GR_GL(standard)) {
35 } else if (GR_IS_GR_WEBGL(standard)) {
37 }
38 return nullptr;
39}
#define GET_PROC_LOCAL(F)
SK_API sk_sp< const GrGLInterface > GrGLMakeAssembledGLInterface(void *ctx, GrGLGetProc get)
SK_API sk_sp< const GrGLInterface > GrGLMakeAssembledWebGLInterface(void *ctx, GrGLGetProc get)
SK_API sk_sp< const GrGLInterface > GrGLMakeAssembledGLESInterface(void *ctx, GrGLGetProc get)
GrGLStandard
Definition: GrGLTypes.h:19
#define GR_IS_GR_WEBGL(standard)
Definition: GrGLTypes.h:50
#define GR_IS_GR_GL(standard)
Definition: GrGLTypes.h:48
#define GR_IS_GR_GL_ES(standard)
Definition: GrGLTypes.h:49
GrGLStandard GrGLGetStandardInUseFromString(const char *versionString)
Definition: GrGLUtil.cpp:31
void sk_ignore_unused_variable(const T &)
Definition: SkTemplates.h:37

◆ GrGLMakeAssembledWebGLInterface()

SK_API sk_sp< const GrGLInterface > GrGLMakeAssembledWebGLInterface ( void *  ctx,
GrGLGetProc  get 
)

Generic function for creating a GrGLInterface for a WebGL (similar to OpenGL ES) context. It calls get() to get each function address. ctx is a generic ptr passed to and interpreted by get().

Definition at line 17 of file GrGLAssembleWebGLInterfaceAutogen.cpp.

17 {
18 return nullptr;
19}