Flutter Engine
The Flutter Engine
GrGLAssembleWebGLInterfaceAutogen.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2019 Google LLC
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 * THIS FILE IS AUTOGENERATED
8 * Make edits to tools/gpu/gl/interface/templates.go or they will
9 * be overwritten.
10 */
11
15
16#if SK_DISABLE_WEBGL_INTERFACE || !defined(__EMSCRIPTEN__)
18 return nullptr;
19}
20#else
21
22// Located https://github.com/emscripten-core/emscripten/tree/7ba7700902c46734987585409502f3c63beb650f/system/include/GLES3
23#define GL_GLEXT_PROTOTYPES
24#include <GLES3/gl32.h>
25#include <GLES3/gl2ext.h>
26#include <webgl/webgl2_ext.h>
27
28#define GET_PROC(F) functions->f##F = gl##F
29#define GET_PROC_SUFFIX(F, S) functions->f##F = gl##F##S
30
32 const char* verStr = reinterpret_cast<const char*>(glGetString(GR_GL_VERSION));
34 if (glVer < GR_GL_VER(1,0)) {
35 return nullptr;
36 }
37
39 if (!extensions.init(kWebGL_GrGLStandard, glGetString, glGetStringi, glGetIntegerv)) {
40 return nullptr;
41 }
42
44 GrGLInterface::Functions* functions = &interface->fFunctions;
45
46 // Autogenerated content follows
47 GET_PROC(ActiveTexture);
48 GET_PROC(AttachShader);
49 GET_PROC(BindAttribLocation);
50 GET_PROC(BindBuffer);
51 GET_PROC(BindTexture);
52 GET_PROC(BlendColor);
54 GET_PROC(BlendFunc);
55 GET_PROC(BufferData);
56 GET_PROC(BufferSubData);
57 GET_PROC(Clear);
58 GET_PROC(ClearColor);
59 GET_PROC(ClearStencil);
60 GET_PROC(ColorMask);
61 GET_PROC(CompileShader);
62 GET_PROC(CompressedTexImage2D);
63 GET_PROC(CompressedTexSubImage2D);
64 GET_PROC(CopyTexSubImage2D);
65 GET_PROC(CreateProgram);
66 GET_PROC(CreateShader);
67 GET_PROC(CullFace);
68 GET_PROC(DeleteBuffers);
69 GET_PROC(DeleteProgram);
70 GET_PROC(DeleteShader);
71 GET_PROC(DeleteTextures);
72 GET_PROC(DepthMask);
73 GET_PROC(Disable);
74 GET_PROC(DisableVertexAttribArray);
75 GET_PROC(DrawArrays);
76 GET_PROC(DrawElements);
77 GET_PROC(Enable);
78 GET_PROC(EnableVertexAttribArray);
81 GET_PROC(FrontFace);
82 GET_PROC(GenBuffers);
83 GET_PROC(GenTextures);
84 GET_PROC(GetBufferParameteriv);
85 GET_PROC(GetError);
86 GET_PROC(GetFloatv);
87 GET_PROC(GetIntegerv);
88 GET_PROC(GetProgramInfoLog);
89 GET_PROC(GetProgramiv);
91 GET_PROC(GetShaderiv);
92 GET_PROC(GetString);
93 GET_PROC(GetUniformLocation);
94 GET_PROC(IsTexture);
95 GET_PROC(LineWidth);
97 GET_PROC(PixelStorei);
98 GET_PROC(ReadPixels);
99 GET_PROC(Scissor);
100 GET_PROC(ShaderSource);
101 GET_PROC(StencilFunc);
102 GET_PROC(StencilFuncSeparate);
103 GET_PROC(StencilMask);
104 GET_PROC(StencilMaskSeparate);
106 GET_PROC(StencilOpSeparate);
107 GET_PROC(TexImage2D);
108 GET_PROC(TexParameterf);
109 GET_PROC(TexParameterfv);
110 GET_PROC(TexParameteri);
111 GET_PROC(TexParameteriv);
112 GET_PROC(TexSubImage2D);
113 GET_PROC(Uniform1f);
114 GET_PROC(Uniform1fv);
115 GET_PROC(Uniform1i);
116 GET_PROC(Uniform1iv);
117 GET_PROC(Uniform2f);
118 GET_PROC(Uniform2fv);
119 GET_PROC(Uniform2i);
120 GET_PROC(Uniform2iv);
121 GET_PROC(Uniform3f);
122 GET_PROC(Uniform3fv);
123 GET_PROC(Uniform3i);
124 GET_PROC(Uniform3iv);
125 GET_PROC(Uniform4f);
126 GET_PROC(Uniform4fv);
127 GET_PROC(Uniform4i);
128 GET_PROC(Uniform4iv);
129 GET_PROC(UniformMatrix2fv);
130 GET_PROC(UniformMatrix3fv);
131 GET_PROC(UniformMatrix4fv);
132 GET_PROC(UseProgram);
133 GET_PROC(VertexAttrib1f);
134 GET_PROC(VertexAttrib2fv);
135 GET_PROC(VertexAttrib3fv);
136 GET_PROC(VertexAttrib4fv);
137 GET_PROC(VertexAttribPointer);
138 GET_PROC(Viewport);
139
140 if (glVer >= GR_GL_VER(2,0)) {
141 GET_PROC(GetStringi);
142 }
143
144 if (glVer >= GR_GL_VER(2,0)) {
145 GET_PROC(BindVertexArray);
146 GET_PROC(DeleteVertexArrays);
147 GET_PROC(GenVertexArrays);
148 } else if (extensions.has("GL_OES_vertex_array_object")) {
149 GET_PROC_SUFFIX(BindVertexArray, OES);
150 GET_PROC_SUFFIX(DeleteVertexArrays, OES);
151 GET_PROC_SUFFIX(GenVertexArrays, OES);
152 } else if (extensions.has("OES_vertex_array_object")) {
153 GET_PROC_SUFFIX(BindVertexArray, OES);
154 GET_PROC_SUFFIX(DeleteVertexArrays, OES);
155 GET_PROC_SUFFIX(GenVertexArrays, OES);
156 }
157
158 if (glVer >= GR_GL_VER(2,0)) {
159 GET_PROC(DrawArraysInstanced);
160 GET_PROC(DrawElementsInstanced);
161 }
162
163 if (extensions.has("GL_WEBGL_draw_instanced_base_vertex_base_instance")) {
164 GET_PROC_SUFFIX(DrawArraysInstancedBaseInstance, WEBGL);
165 GET_PROC_SUFFIX(DrawElementsInstancedBaseVertexBaseInstance, WEBGL);
166 }
167
168 if (glVer >= GR_GL_VER(2,0)) {
169 GET_PROC(DrawBuffers);
170 GET_PROC(ReadBuffer);
171 }
172
173 if (extensions.has("GL_WEBGL_multi_draw_instanced_base_vertex_base_instance")) {
174 GET_PROC_SUFFIX(MultiDrawArraysInstancedBaseInstance, WEBGL);
175 GET_PROC_SUFFIX(MultiDrawElementsInstancedBaseVertexBaseInstance, WEBGL);
176 }
177
178 if (glVer >= GR_GL_VER(2,0)) {
179 GET_PROC(DrawRangeElements);
180 }
181
182 if (glVer >= GR_GL_VER(2,0)) {
183 GET_PROC(TexStorage2D);
184 }
185
186 if (glVer >= GR_GL_VER(2,0)) {
187 GET_PROC(VertexAttribDivisor);
188 }
189
190 if (glVer >= GR_GL_VER(2,0)) {
191 GET_PROC(VertexAttribIPointer);
192 }
193
194 GET_PROC(BindFramebuffer);
195 GET_PROC(BindRenderbuffer);
196 GET_PROC(CheckFramebufferStatus);
197 GET_PROC(DeleteFramebuffers);
198 GET_PROC(DeleteRenderbuffers);
199 GET_PROC(FramebufferRenderbuffer);
200 GET_PROC(FramebufferTexture2D);
201 GET_PROC(GenFramebuffers);
202 GET_PROC(GenRenderbuffers);
203 GET_PROC(GenerateMipmap);
204 GET_PROC(GetFramebufferAttachmentParameteriv);
205 GET_PROC(GetRenderbufferParameteriv);
206 GET_PROC(RenderbufferStorage);
207
208 if (glVer >= GR_GL_VER(2,0)) {
209 GET_PROC(BlitFramebuffer);
210 }
211
212 if (glVer >= GR_GL_VER(2,0)) {
213 GET_PROC(RenderbufferStorageMultisample);
214 }
215
216 if (glVer >= GR_GL_VER(2,0)) {
217 GET_PROC(CopyBufferSubData);
218 }
219
220 if (glVer >= GR_GL_VER(2,0)) {
221 GET_PROC(ClientWaitSync);
222 GET_PROC(DeleteSync);
223 GET_PROC(FenceSync);
224 GET_PROC(IsSync);
225 GET_PROC(WaitSync);
226 }
227
228 if (glVer >= GR_GL_VER(2,0)) {
229 GET_PROC(BindSampler);
230 GET_PROC(DeleteSamplers);
231 GET_PROC(GenSamplers);
232 GET_PROC(SamplerParameterf);
233 GET_PROC(SamplerParameteri);
234 GET_PROC(SamplerParameteriv);
235 }
236
237 if (glVer >= GR_GL_VER(2,0)) {
238 GET_PROC(InvalidateFramebuffer);
239 GET_PROC(InvalidateSubFramebuffer);
240 }
241
242 GET_PROC(GetShaderPrecisionFormat);
243
244
245 // End autogenerated content
246
247 interface->fStandard = kWebGL_GrGLStandard;
248 interface->fExtensions.swap(&extensions);
249
250 return interface;
251}
252#endif
#define GET_PROC_SUFFIX(F, S)
GrGLFuncPtr(* GrGLGetProc)(void *ctx, const char name[])
sk_sp< const GrGLInterface > GrGLMakeAssembledWebGLInterface(void *ctx, GrGLGetProc get)
#define GR_GL_VERSION
Definition: GrGLDefines.h:602
@ kWebGL_GrGLStandard
Definition: GrGLTypes.h:23
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)
const myers::Point & get(const myers::Segment &)
BlendEquation
Definition: Blend.h:26
void Flush(SkSurface *surface)
Definition: GpuTools.h:25