Flutter Engine
The Flutter Engine
Macros | Functions
GrGLAssembleGLInterfaceAutogen.cpp File Reference
#include "include/gpu/gl/GrGLAssembleHelpers.h"
#include "include/gpu/gl/GrGLAssembleInterface.h"
#include "src/gpu/ganesh/gl/GrGLUtil.h"

Go to the source code of this file.

Macros

#define GET_PROC(F)   functions->f##F = (GrGL##F##Fn*)get(ctx, "gl" #F)
 
#define GET_PROC_SUFFIX(F, S)   functions->f##F = (GrGL##F##Fn*)get(ctx, "gl" #F #S)
 
#define GET_PROC_LOCAL(F)   GrGL##F##Fn* F = (GrGL##F##Fn*)get(ctx, "gl" #F)
 
#define GET_EGL_PROC_SUFFIX(F, S)   functions->fEGL##F = (GrEGL##F##Fn*)get(ctx, "egl" #F #S)
 

Functions

sk_sp< const GrGLInterfaceGrGLMakeAssembledGLInterface (void *ctx, GrGLGetProc get)
 

Macro Definition Documentation

◆ GET_EGL_PROC_SUFFIX

#define GET_EGL_PROC_SUFFIX (   F,
 
)    functions->fEGL##F = (GrEGL##F##Fn*)get(ctx, "egl" #F #S)

Definition at line 20 of file GrGLAssembleGLInterfaceAutogen.cpp.

◆ GET_PROC

#define GET_PROC (   F)    functions->f##F = (GrGL##F##Fn*)get(ctx, "gl" #F)

Definition at line 16 of file GrGLAssembleGLInterfaceAutogen.cpp.

◆ GET_PROC_LOCAL

#define GET_PROC_LOCAL (   F)    GrGL##F##Fn* F = (GrGL##F##Fn*)get(ctx, "gl" #F)

Definition at line 18 of file GrGLAssembleGLInterfaceAutogen.cpp.

◆ GET_PROC_SUFFIX

#define GET_PROC_SUFFIX (   F,
 
)    functions->f##F = (GrGL##F##Fn*)get(ctx, "gl" #F #S)

Definition at line 17 of file GrGLAssembleGLInterfaceAutogen.cpp.

Function Documentation

◆ GrGLMakeAssembledGLInterface()

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)
void GrGetEGLQueryAndDisplay(GrEGLQueryStringFn **queryString, GrEGLDisplay *display, void *ctx, GrGLGetProc get)
#define GR_GL_VERSION
Definition: GrGLDefines.h:602
const char *GR_GL_FUNCTION_TYPE(GrEGLDisplay dpy, GrEGLint name) GrEGLQueryStringFn
@ kGL_GrGLStandard
Definition: GrGLTypes.h:21
void * GrEGLDisplay
Definition: GrGLTypes.h:166
GrGLVersion GrGLGetVersionFromString(const char *versionString)
Definition: GrGLUtil.cpp:68
#define GR_GL_INVALID_VER
Definition: GrGLUtil.h:37
#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)
PolygonMode
Definition: formats.h:383
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)
const myers::Point & get(const myers::Segment &)
BlendEquation
Definition: Blend.h:26
void Flush(SkSurface *surface)
Definition: GpuTools.h:25