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 * THIS FILE IS AUTOGENERATED
8 * Make edits to tools/gpu/gl/interface/templates.go or they will
9 * be overwritten.
10 */
11
12 #include "include/gpu/gl/GrGLExtensions.h"
13 #include "include/gpu/gl/GrGLInterface.h"
14 #include "src/gpu/gl/GrGLUtil.h"
15
16 #include <stdio.h>
17
GrGLInterface()18 GrGLInterface::GrGLInterface() {
19 fStandard = kNone_GrGLStandard;
20 }
21
22 #define RETURN_FALSE_INTERFACE \
23 SkDEBUGF("%s:%d GrGLInterface::validate() failed.\n", __FILE__, __LINE__); \
24 return false
25
validate() const26 bool GrGLInterface::validate() const {
27
28 if (kNone_GrGLStandard == fStandard) {
29 RETURN_FALSE_INTERFACE;
30 }
31
32 if (!fExtensions.isInitialized()) {
33 RETURN_FALSE_INTERFACE;
34 }
35
36 GrGLVersion glVer = GrGLGetVersion(this);
37 if (GR_GL_INVALID_VER == glVer) {
38 RETURN_FALSE_INTERFACE;
39 }
40 // Autogenerated content follows
41 if (!fFunctions.fActiveTexture ||
42 !fFunctions.fAttachShader ||
43 !fFunctions.fBindAttribLocation ||
44 !fFunctions.fBindBuffer ||
45 !fFunctions.fBindTexture ||
46 !fFunctions.fBlendColor ||
47 !fFunctions.fBlendEquation ||
48 !fFunctions.fBlendFunc ||
49 !fFunctions.fBufferData ||
50 !fFunctions.fBufferSubData ||
51 !fFunctions.fClear ||
52 !fFunctions.fClearColor ||
53 !fFunctions.fClearStencil ||
54 !fFunctions.fColorMask ||
55 !fFunctions.fCompileShader ||
56 !fFunctions.fCompressedTexImage2D ||
57 !fFunctions.fCompressedTexSubImage2D ||
58 !fFunctions.fCopyTexSubImage2D ||
59 !fFunctions.fCreateProgram ||
60 !fFunctions.fCreateShader ||
61 !fFunctions.fCullFace ||
62 !fFunctions.fDeleteBuffers ||
63 !fFunctions.fDeleteProgram ||
64 !fFunctions.fDeleteShader ||
65 !fFunctions.fDeleteTextures ||
66 !fFunctions.fDepthMask ||
67 !fFunctions.fDisable ||
68 !fFunctions.fDisableVertexAttribArray ||
69 !fFunctions.fDrawArrays ||
70 !fFunctions.fDrawElements ||
71 !fFunctions.fEnable ||
72 !fFunctions.fEnableVertexAttribArray ||
73 !fFunctions.fFinish ||
74 !fFunctions.fFlush ||
75 !fFunctions.fFrontFace ||
76 !fFunctions.fGenBuffers ||
77 !fFunctions.fGenTextures ||
78 !fFunctions.fGetBufferParameteriv ||
79 !fFunctions.fGetError ||
80 !fFunctions.fGetIntegerv ||
81 !fFunctions.fGetProgramInfoLog ||
82 !fFunctions.fGetProgramiv ||
83 !fFunctions.fGetShaderInfoLog ||
84 !fFunctions.fGetShaderiv ||
85 !fFunctions.fGetString ||
86 !fFunctions.fGetUniformLocation ||
87 !fFunctions.fIsTexture ||
88 !fFunctions.fLineWidth ||
89 !fFunctions.fLinkProgram ||
90 !fFunctions.fPixelStorei ||
91 !fFunctions.fReadPixels ||
92 !fFunctions.fScissor ||
93 !fFunctions.fShaderSource ||
94 !fFunctions.fStencilFunc ||
95 !fFunctions.fStencilFuncSeparate ||
96 !fFunctions.fStencilMask ||
97 !fFunctions.fStencilMaskSeparate ||
98 !fFunctions.fStencilOp ||
99 !fFunctions.fStencilOpSeparate ||
100 !fFunctions.fTexImage2D ||
101 !fFunctions.fTexParameterf ||
102 !fFunctions.fTexParameterfv ||
103 !fFunctions.fTexParameteri ||
104 !fFunctions.fTexParameteriv ||
105 !fFunctions.fTexSubImage2D ||
106 !fFunctions.fUniform1f ||
107 !fFunctions.fUniform1fv ||
108 !fFunctions.fUniform1i ||
109 !fFunctions.fUniform1iv ||
110 !fFunctions.fUniform2f ||
111 !fFunctions.fUniform2fv ||
112 !fFunctions.fUniform2i ||
113 !fFunctions.fUniform2iv ||
114 !fFunctions.fUniform3f ||
115 !fFunctions.fUniform3fv ||
116 !fFunctions.fUniform3i ||
117 !fFunctions.fUniform3iv ||
118 !fFunctions.fUniform4f ||
119 !fFunctions.fUniform4fv ||
120 !fFunctions.fUniform4i ||
121 !fFunctions.fUniform4iv ||
122 !fFunctions.fUniformMatrix2fv ||
123 !fFunctions.fUniformMatrix3fv ||
124 !fFunctions.fUniformMatrix4fv ||
125 !fFunctions.fUseProgram ||
126 !fFunctions.fVertexAttrib1f ||
127 !fFunctions.fVertexAttrib2fv ||
128 !fFunctions.fVertexAttrib3fv ||
129 !fFunctions.fVertexAttrib4fv ||
130 !fFunctions.fVertexAttribPointer ||
131 !fFunctions.fViewport) {
132 RETURN_FALSE_INTERFACE;
133 }
134
135 if (GR_IS_GR_GL(fStandard)) {
136 if (!fFunctions.fDrawBuffer ||
137 !fFunctions.fPolygonMode) {
138 RETURN_FALSE_INTERFACE;
139 }
140 }
141
142 if ((GR_IS_GR_GL(fStandard) && (
143 (glVer >= GR_GL_VER(3,0)))) ||
144 (GR_IS_GR_GL_ES(fStandard) && (
145 (glVer >= GR_GL_VER(3,0)))) ||
146 (GR_IS_GR_WEBGL(fStandard) && (
147 (glVer >= GR_GL_VER(2,0))))) {
148 if (!fFunctions.fGetStringi) {
149 RETURN_FALSE_INTERFACE;
150 }
151 }
152
153 if (GR_IS_GR_GL(fStandard) ||
154 (GR_IS_GR_GL_ES(fStandard) && (
155 (glVer >= GR_GL_VER(3,0)) ||
156 fExtensions.has("GL_OES_vertex_array_object"))) ||
157 (GR_IS_GR_WEBGL(fStandard) && (
158 (glVer >= GR_GL_VER(2,0)) ||
159 fExtensions.has("GL_OES_vertex_array_object") ||
160 fExtensions.has("OES_vertex_array_object")))) {
161 if (!fFunctions.fBindVertexArray ||
162 !fFunctions.fDeleteVertexArrays ||
163 !fFunctions.fGenVertexArrays) {
164 RETURN_FALSE_INTERFACE;
165 }
166 }
167
168 if ((GR_IS_GR_GL(fStandard) && (
169 (glVer >= GR_GL_VER(3,0)))) ||
170 (GR_IS_GR_GL_ES(fStandard) && (
171 (glVer >= GR_GL_VER(3,0) && fExtensions.has("GL_EXT_blend_func_extended"))))) {
172 if (!fFunctions.fBindFragDataLocation) {
173 RETURN_FALSE_INTERFACE;
174 }
175 }
176
177 if ((GR_IS_GR_GL(fStandard) && (
178 (glVer >= GR_GL_VER(3,3)) ||
179 fExtensions.has("GL_ARB_blend_func_extended"))) ||
180 (GR_IS_GR_GL_ES(fStandard) && (
181 (glVer >= GR_GL_VER(3,0) && fExtensions.has("GL_EXT_blend_func_extended"))))) {
182 if (!fFunctions.fBindFragDataLocationIndexed) {
183 RETURN_FALSE_INTERFACE;
184 }
185 }
186
187 if ((GR_IS_GR_GL(fStandard) && (
188 fExtensions.has("GL_KHR_blend_equation_advanced") ||
189 fExtensions.has("GL_NV_blend_equation_advanced"))) ||
190 (GR_IS_GR_GL_ES(fStandard) && (
191 fExtensions.has("GL_KHR_blend_equation_advanced") ||
192 fExtensions.has("GL_NV_blend_equation_advanced")))) {
193 if (!fFunctions.fBlendBarrier) {
194 RETURN_FALSE_INTERFACE;
195 }
196 }
197
198 if ((GR_IS_GR_GL(fStandard) && (
199 (glVer >= GR_GL_VER(4,4)) ||
200 fExtensions.has("GL_ARB_clear_texture"))) ||
201 (GR_IS_GR_GL_ES(fStandard) && (
202 fExtensions.has("GL_EXT_clear_texture")))) {
203 // all functions were marked optional or test_only
204 }
205
206 if ((GR_IS_GR_GL(fStandard) && (
207 (glVer >= GR_GL_VER(3,1)) ||
208 fExtensions.has("GL_ARB_draw_instanced") ||
209 fExtensions.has("GL_EXT_draw_instanced"))) ||
210 (GR_IS_GR_GL_ES(fStandard) && (
211 (glVer >= GR_GL_VER(3,0)) ||
212 fExtensions.has("GL_EXT_draw_instanced"))) ||
213 (GR_IS_GR_WEBGL(fStandard) && (
214 (glVer >= GR_GL_VER(2,0))))) {
215 if (!fFunctions.fDrawArraysInstanced ||
216 !fFunctions.fDrawElementsInstanced) {
217 RETURN_FALSE_INTERFACE;
218 }
219 }
220
221 if (GR_IS_GR_GL(fStandard) ||
222 (GR_IS_GR_GL_ES(fStandard) && (
223 (glVer >= GR_GL_VER(3,0)))) ||
224 (GR_IS_GR_WEBGL(fStandard) && (
225 (glVer >= GR_GL_VER(2,0))))) {
226 if (!fFunctions.fDrawBuffers ||
227 !fFunctions.fReadBuffer) {
228 RETURN_FALSE_INTERFACE;
229 }
230 }
231
232 if ((GR_IS_GR_GL(fStandard) && (
233 (glVer >= GR_GL_VER(4,0)) ||
234 fExtensions.has("GL_ARB_draw_indirect"))) ||
235 (GR_IS_GR_GL_ES(fStandard) && (
236 (glVer >= GR_GL_VER(3,1))))) {
237 if (!fFunctions.fDrawArraysIndirect ||
238 !fFunctions.fDrawElementsIndirect) {
239 RETURN_FALSE_INTERFACE;
240 }
241 }
242
243 if (GR_IS_GR_GL(fStandard) ||
244 (GR_IS_GR_GL_ES(fStandard) && (
245 (glVer >= GR_GL_VER(3,0)))) ||
246 (GR_IS_GR_WEBGL(fStandard) && (
247 (glVer >= GR_GL_VER(2,0))))) {
248 if (!fFunctions.fDrawRangeElements) {
249 RETURN_FALSE_INTERFACE;
250 }
251 }
252
253 if ((GR_IS_GR_GL(fStandard) && (
254 (glVer >= GR_GL_VER(3,2)) ||
255 fExtensions.has("GL_ARB_texture_multisample"))) ||
256 (GR_IS_GR_GL_ES(fStandard) && (
257 (glVer >= GR_GL_VER(3,1))))) {
258 if (!fFunctions.fGetMultisamplefv) {
259 RETURN_FALSE_INTERFACE;
260 }
261 }
262
263 if (GR_IS_GR_GL(fStandard) ||
264 (GR_IS_GR_GL_ES(fStandard) && (
265 (glVer >= GR_GL_VER(3,1))))) {
266 if (!fFunctions.fGetTexLevelParameteriv) {
267 RETURN_FALSE_INTERFACE;
268 }
269 }
270
271 if ((GR_IS_GR_GL(fStandard) && (
272 (glVer >= GR_GL_VER(4,3)) ||
273 fExtensions.has("GL_ARB_multi_draw_indirect"))) ||
274 (GR_IS_GR_GL_ES(fStandard) && (
275 fExtensions.has("GL_EXT_multi_draw_indirect")))) {
276 if (!fFunctions.fMultiDrawArraysIndirect ||
277 !fFunctions.fMultiDrawElementsIndirect) {
278 RETURN_FALSE_INTERFACE;
279 }
280 }
281
282 if ((GR_IS_GR_GL(fStandard) && (
283 (glVer >= GR_GL_VER(3,1)))) ||
284 (GR_IS_GR_GL_ES(fStandard) && (
285 (glVer >= GR_GL_VER(3,2)) ||
286 fExtensions.has("GL_OES_texture_buffer") ||
287 fExtensions.has("GL_EXT_texture_buffer")))) {
288 if (!fFunctions.fTexBuffer) {
289 RETURN_FALSE_INTERFACE;
290 }
291 }
292
293 if ((GR_IS_GR_GL(fStandard) && (
294 (glVer >= GR_GL_VER(4,3)))) ||
295 (GR_IS_GR_GL_ES(fStandard) && (
296 (glVer >= GR_GL_VER(3,2)) ||
297 fExtensions.has("GL_OES_texture_buffer") ||
298 fExtensions.has("GL_EXT_texture_buffer")))) {
299 if (!fFunctions.fTexBufferRange) {
300 RETURN_FALSE_INTERFACE;
301 }
302 }
303
304 if ((GR_IS_GR_GL(fStandard) && (
305 (glVer >= GR_GL_VER(4,2)) ||
306 fExtensions.has("GL_ARB_texture_storage") ||
307 fExtensions.has("GL_EXT_texture_storage"))) ||
308 (GR_IS_GR_GL_ES(fStandard) && (
309 (glVer >= GR_GL_VER(3,0)) ||
310 fExtensions.has("GL_EXT_texture_storage"))) ||
311 (GR_IS_GR_WEBGL(fStandard) && (
312 (glVer >= GR_GL_VER(2,0))))) {
313 if (!fFunctions.fTexStorage2D) {
314 RETURN_FALSE_INTERFACE;
315 }
316 }
317
318 if ((GR_IS_GR_GL(fStandard) && (
319 (glVer >= GR_GL_VER(4,5)) ||
320 fExtensions.has("GL_ARB_texture_barrier") ||
321 fExtensions.has("GL_NV_texture_barrier"))) ||
322 (GR_IS_GR_GL_ES(fStandard) && (
323 fExtensions.has("GL_NV_texture_barrier")))) {
324 if (!fFunctions.fTextureBarrier) {
325 RETURN_FALSE_INTERFACE;
326 }
327 }
328
329 if ((GR_IS_GR_GL_ES(fStandard) && (
330 fExtensions.has("GL_EXT_discard_framebuffer")))) {
331 if (!fFunctions.fDiscardFramebuffer) {
332 RETURN_FALSE_INTERFACE;
333 }
334 }
335
336 if ((GR_IS_GR_GL(fStandard) && (
337 (glVer >= GR_GL_VER(3,2)) ||
338 fExtensions.has("GL_ARB_instanced_arrays"))) ||
339 (GR_IS_GR_GL_ES(fStandard) && (
340 (glVer >= GR_GL_VER(3,0)) ||
341 fExtensions.has("GL_EXT_instanced_arrays")))) {
342 if (!fFunctions.fVertexAttribDivisor) {
343 RETURN_FALSE_INTERFACE;
344 }
345 }
346
347 if ((GR_IS_GR_GL(fStandard) && (
348 (glVer >= GR_GL_VER(3,0)))) ||
349 (GR_IS_GR_GL_ES(fStandard) && (
350 (glVer >= GR_GL_VER(3,0)))) ||
351 (GR_IS_GR_WEBGL(fStandard) && (
352 (glVer >= GR_GL_VER(2,0))))) {
353 if (!fFunctions.fVertexAttribIPointer) {
354 RETURN_FALSE_INTERFACE;
355 }
356 }
357
358 if ((GR_IS_GR_GL(fStandard) && (
359 (glVer >= GR_GL_VER(3,0)) ||
360 fExtensions.has("GL_ARB_framebuffer_object") ||
361 fExtensions.has("GL_EXT_framebuffer_object"))) ||
362 GR_IS_GR_GL_ES(fStandard) ||
363 GR_IS_GR_WEBGL(fStandard)) {
364 if (!fFunctions.fBindFramebuffer ||
365 !fFunctions.fBindRenderbuffer ||
366 !fFunctions.fCheckFramebufferStatus ||
367 !fFunctions.fDeleteFramebuffers ||
368 !fFunctions.fDeleteRenderbuffers ||
369 !fFunctions.fFramebufferRenderbuffer ||
370 !fFunctions.fFramebufferTexture2D ||
371 !fFunctions.fGenFramebuffers ||
372 !fFunctions.fGenRenderbuffers ||
373 !fFunctions.fGenerateMipmap ||
374 !fFunctions.fGetFramebufferAttachmentParameteriv ||
375 !fFunctions.fGetRenderbufferParameteriv ||
376 !fFunctions.fRenderbufferStorage) {
377 RETURN_FALSE_INTERFACE;
378 }
379 }
380
381 if ((GR_IS_GR_GL(fStandard) && (
382 (glVer >= GR_GL_VER(3,0)) ||
383 fExtensions.has("GL_ARB_framebuffer_object") ||
384 fExtensions.has("GL_EXT_framebuffer_blit"))) ||
385 (GR_IS_GR_GL_ES(fStandard) && (
386 (glVer >= GR_GL_VER(3,0)) ||
387 fExtensions.has("GL_CHROMIUM_framebuffer_multisample") ||
388 fExtensions.has("GL_ANGLE_framebuffer_blit")))) {
389 if (!fFunctions.fBlitFramebuffer) {
390 RETURN_FALSE_INTERFACE;
391 }
392 }
393
394 if ((GR_IS_GR_GL(fStandard) && (
395 (glVer >= GR_GL_VER(3,0)) ||
396 fExtensions.has("GL_ARB_framebuffer_object") ||
397 fExtensions.has("GL_EXT_framebuffer_multisample"))) ||
398 (GR_IS_GR_GL_ES(fStandard) && (
399 (glVer >= GR_GL_VER(3,0)) ||
400 fExtensions.has("GL_CHROMIUM_framebuffer_multisample") ||
401 fExtensions.has("GL_ANGLE_framebuffer_multisample"))) ||
402 (GR_IS_GR_WEBGL(fStandard) && (
403 (glVer >= GR_GL_VER(2,0))))) {
404 if (!fFunctions.fRenderbufferStorageMultisample) {
405 RETURN_FALSE_INTERFACE;
406 }
407 }
408
409 if ((GR_IS_GR_GL_ES(fStandard) && (
410 fExtensions.has("GL_CHROMIUM_map_sub")))) {
411 if (!fFunctions.fMapBufferSubData ||
412 !fFunctions.fMapTexSubImage2D ||
413 !fFunctions.fUnmapBufferSubData ||
414 !fFunctions.fUnmapTexSubImage2D) {
415 RETURN_FALSE_INTERFACE;
416 }
417 }
418
419 if ((GR_IS_GR_GL_ES(fStandard) && (
420 fExtensions.has("GL_EXT_multisampled_render_to_texture") ||
421 fExtensions.has("GL_IMG_multisampled_render_to_texture")))) {
422 if (!fFunctions.fFramebufferTexture2DMultisample) {
423 RETURN_FALSE_INTERFACE;
424 }
425 }
426
427 if ((GR_IS_GR_GL_ES(fStandard) && (
428 fExtensions.has("GL_EXT_multisampled_render_to_texture")))) {
429 if (!fFunctions.fRenderbufferStorageMultisampleES2EXT) {
430 RETURN_FALSE_INTERFACE;
431 }
432 }
433
434 if ((GR_IS_GR_GL_ES(fStandard) && (
435 fExtensions.has("GL_IMG_multisampled_render_to_texture")))) {
436 if (!fFunctions.fRenderbufferStorageMultisampleES2EXT) {
437 RETURN_FALSE_INTERFACE;
438 }
439 }
440
441 if ((GR_IS_GR_GL_ES(fStandard) && (
442 fExtensions.has("GL_APPLE_framebuffer_multisample")))) {
443 if (!fFunctions.fResolveMultisampleFramebuffer ||
444 !fFunctions.fRenderbufferStorageMultisampleES2APPLE) {
445 RETURN_FALSE_INTERFACE;
446 }
447 }
448
449 if (GR_IS_GR_GL(fStandard) ||
450 (GR_IS_GR_GL_ES(fStandard) && (
451 fExtensions.has("GL_OES_mapbuffer")))) {
452 if (!fFunctions.fMapBuffer) {
453 RETURN_FALSE_INTERFACE;
454 }
455 }
456
457 if (GR_IS_GR_GL(fStandard) ||
458 (GR_IS_GR_GL_ES(fStandard) && (
459 (glVer >= GR_GL_VER(3,0)) ||
460 fExtensions.has("GL_OES_mapbuffer")))) {
461 if (!fFunctions.fUnmapBuffer) {
462 RETURN_FALSE_INTERFACE;
463 }
464 }
465
466 if ((GR_IS_GR_GL(fStandard) && (
467 (glVer >= GR_GL_VER(3,0)) ||
468 fExtensions.has("GL_ARB_map_buffer_range"))) ||
469 (GR_IS_GR_GL_ES(fStandard) && (
470 (glVer >= GR_GL_VER(3,0)) ||
471 fExtensions.has("GL_EXT_map_buffer_range")))) {
472 if (!fFunctions.fFlushMappedBufferRange ||
473 !fFunctions.fMapBufferRange) {
474 RETURN_FALSE_INTERFACE;
475 }
476 }
477
478 if ((GR_IS_GR_GL(fStandard) && (
479 fExtensions.has("GL_EXT_debug_marker"))) ||
480 (GR_IS_GR_GL_ES(fStandard) && (
481 fExtensions.has("GL_EXT_debug_marker")))) {
482 if (!fFunctions.fInsertEventMarker ||
483 !fFunctions.fPopGroupMarker ||
484 !fFunctions.fPushGroupMarker) {
485 RETURN_FALSE_INTERFACE;
486 }
487 }
488
489 if ((GR_IS_GR_GL(fStandard) && (
490 (glVer >= GR_GL_VER(4,3)) ||
491 fExtensions.has("GL_ARB_program_interface_query"))) ||
492 (GR_IS_GR_GL_ES(fStandard) && (
493 (glVer >= GR_GL_VER(3,1))))) {
494 if (!fFunctions.fGetProgramResourceLocation) {
495 RETURN_FALSE_INTERFACE;
496 }
497 }
498
499 if ((GR_IS_GR_GL(fStandard) && (
500 fExtensions.has("GL_NV_path_rendering"))) ||
501 (GR_IS_GR_GL_ES(fStandard) && (
502 fExtensions.has("GL_CHROMIUM_path_rendering") ||
503 fExtensions.has("GL_NV_path_rendering")))) {
504 if (!fFunctions.fMatrixLoadIdentity ||
505 !fFunctions.fMatrixLoadf) {
506 RETURN_FALSE_INTERFACE;
507 }
508 }
509
510 if ((GR_IS_GR_GL(fStandard) && (
511 fExtensions.has("GL_NV_path_rendering"))) ||
512 (GR_IS_GR_GL_ES(fStandard) && (
513 fExtensions.has("GL_CHROMIUM_path_rendering") ||
514 fExtensions.has("GL_NV_path_rendering")))) {
515 if (!fFunctions.fCoverFillPath ||
516 !fFunctions.fCoverFillPathInstanced ||
517 !fFunctions.fCoverStrokePath ||
518 !fFunctions.fCoverStrokePathInstanced ||
519 !fFunctions.fDeletePaths ||
520 !fFunctions.fGenPaths ||
521 !fFunctions.fIsPath ||
522 !fFunctions.fPathCommands ||
523 !fFunctions.fPathParameterf ||
524 !fFunctions.fPathParameteri ||
525 !fFunctions.fPathStencilFunc ||
526 !fFunctions.fStencilFillPath ||
527 !fFunctions.fStencilFillPathInstanced ||
528 !fFunctions.fStencilStrokePath ||
529 !fFunctions.fStencilStrokePathInstanced) {
530 RETURN_FALSE_INTERFACE;
531 }
532 }
533
534 if ((GR_IS_GR_GL_ES(fStandard) && (
535 fExtensions.has("GL_CHROMIUM_path_rendering")))) {
536 if (!fFunctions.fBindFragmentInputLocation) {
537 RETURN_FALSE_INTERFACE;
538 }
539 }
540
541 if ((GR_IS_GR_GL(fStandard) && (
542 fExtensions.has("GL_NV_framebuffer_mixed_samples"))) ||
543 (GR_IS_GR_GL_ES(fStandard) && (
544 fExtensions.has("GL_CHROMIUM_framebuffer_mixed_samples") ||
545 fExtensions.has("GL_NV_framebuffer_mixed_samples")))) {
546 if (!fFunctions.fCoverageModulation) {
547 RETURN_FALSE_INTERFACE;
548 }
549 }
550
551 if ((GR_IS_GR_GL(fStandard) && (
552 (glVer >= GR_GL_VER(4,3)) ||
553 fExtensions.has("GL_KHR_debug"))) ||
554 (GR_IS_GR_GL_ES(fStandard) && (
555 fExtensions.has("GL_KHR_debug")))) {
556 if (!fFunctions.fDebugMessageCallback ||
557 !fFunctions.fDebugMessageControl ||
558 !fFunctions.fDebugMessageInsert ||
559 !fFunctions.fGetDebugMessageLog ||
560 !fFunctions.fObjectLabel ||
561 !fFunctions.fPopDebugGroup ||
562 !fFunctions.fPushDebugGroup) {
563 RETURN_FALSE_INTERFACE;
564 }
565 }
566
567 if ((GR_IS_GR_GL_ES(fStandard) && (
568 fExtensions.has("GL_CHROMIUM_bind_uniform_location")))) {
569 if (!fFunctions.fBindUniformLocation) {
570 RETURN_FALSE_INTERFACE;
571 }
572 }
573
574 if ((GR_IS_GR_GL(fStandard) && (
575 fExtensions.has("GL_EXT_window_rectangles"))) ||
576 (GR_IS_GR_GL_ES(fStandard) && (
577 fExtensions.has("GL_EXT_window_rectangles")))) {
578 if (!fFunctions.fWindowRectangles) {
579 RETURN_FALSE_INTERFACE;
580 }
581 }
582
583 if ((GR_IS_GR_GL(fStandard) && (
584 (glVer >= GR_GL_VER(3,2)) ||
585 fExtensions.has("GL_ARB_sync"))) ||
586 (GR_IS_GR_GL_ES(fStandard) && (
587 (glVer >= GR_GL_VER(3,0)) ||
588 fExtensions.has("GL_APPLE_sync"))) ||
589 (GR_IS_GR_WEBGL(fStandard) && (
590 (glVer >= GR_GL_VER(2,0))))) {
591 if (!fFunctions.fClientWaitSync ||
592 !fFunctions.fDeleteSync ||
593 !fFunctions.fFenceSync ||
594 !fFunctions.fIsSync ||
595 !fFunctions.fWaitSync) {
596 RETURN_FALSE_INTERFACE;
597 }
598 }
599
600 if ((GR_IS_GR_GL(fStandard) && (
601 (glVer >= GR_GL_VER(4,2)) ||
602 fExtensions.has("GL_ARB_internalformat_query"))) ||
603 (GR_IS_GR_GL_ES(fStandard) && (
604 (glVer >= GR_GL_VER(3,0))))) {
605 if (!fFunctions.fGetInternalformativ) {
606 RETURN_FALSE_INTERFACE;
607 }
608 }
609
610 if ((GR_IS_GR_GL(fStandard) && (
611 (glVer >= GR_GL_VER(4,1)))) ||
612 (GR_IS_GR_GL_ES(fStandard) && (
613 (glVer >= GR_GL_VER(3,0)) ||
614 fExtensions.has("GL_OES_get_program_binary")))) {
615 if (!fFunctions.fGetProgramBinary ||
616 !fFunctions.fProgramBinary) {
617 RETURN_FALSE_INTERFACE;
618 }
619 }
620
621 if ((GR_IS_GR_GL(fStandard) && (
622 (glVer >= GR_GL_VER(4,1)))) ||
623 (GR_IS_GR_GL_ES(fStandard) && (
624 (glVer >= GR_GL_VER(3,0))))) {
625 if (!fFunctions.fProgramParameteri) {
626 RETURN_FALSE_INTERFACE;
627 }
628 }
629
630 if ((GR_IS_GR_GL(fStandard) && (
631 (glVer >= GR_GL_VER(3,2)) ||
632 fExtensions.has("GL_ARB_sampler_objects"))) ||
633 (GR_IS_GR_GL_ES(fStandard) && (
634 (glVer >= GR_GL_VER(3,0)))) ||
635 (GR_IS_GR_WEBGL(fStandard) && (
636 (glVer >= GR_GL_VER(2,0))))) {
637 if (!fFunctions.fBindSampler ||
638 !fFunctions.fDeleteSamplers ||
639 !fFunctions.fGenSamplers ||
640 !fFunctions.fSamplerParameteri ||
641 !fFunctions.fSamplerParameteriv) {
642 RETURN_FALSE_INTERFACE;
643 }
644 }
645
646 if (GR_IS_GR_GL(fStandard)) {
647 if (!fFunctions.fGetQueryObjectiv) {
648 RETURN_FALSE_INTERFACE;
649 }
650 }
651
652 if (GR_IS_GR_GL(fStandard) ||
653 (GR_IS_GR_GL_ES(fStandard) && (
654 (glVer >= GR_GL_VER(3,0)) ||
655 fExtensions.has("GL_EXT_occlusion_query_boolean")))) {
656 #if GR_TEST_UTILS
657 if (!fFunctions.fBeginQuery ||
658 !fFunctions.fDeleteQueries ||
659 !fFunctions.fEndQuery ||
660 !fFunctions.fGenQueries ||
661 !fFunctions.fGetQueryObjectuiv ||
662 !fFunctions.fGetQueryiv) {
663 RETURN_FALSE_INTERFACE;
664 }
665 #endif
666 // all functions were marked optional or test_only
667 }
668
669 if ((GR_IS_GR_GL(fStandard) && (
670 (glVer >= GR_GL_VER(3,3)) ||
671 fExtensions.has("GL_ARB_timer_query") ||
672 fExtensions.has("GL_EXT_timer_query")))) {
673 if (!fFunctions.fGetQueryObjecti64v ||
674 !fFunctions.fGetQueryObjectui64v) {
675 RETURN_FALSE_INTERFACE;
676 }
677 }
678
679 if ((GR_IS_GR_GL(fStandard) && (
680 (glVer >= GR_GL_VER(3,3)) ||
681 fExtensions.has("GL_ARB_timer_query")))) {
682 if (!fFunctions.fQueryCounter) {
683 RETURN_FALSE_INTERFACE;
684 }
685 }
686
687 if ((GR_IS_GR_GL(fStandard) && (
688 (glVer >= GR_GL_VER(4,3)) ||
689 fExtensions.has("GL_ARB_invalidate_subdata")))) {
690 if (!fFunctions.fInvalidateBufferData ||
691 !fFunctions.fInvalidateBufferSubData ||
692 !fFunctions.fInvalidateTexImage ||
693 !fFunctions.fInvalidateTexSubImage) {
694 RETURN_FALSE_INTERFACE;
695 }
696 }
697
698 if ((GR_IS_GR_GL(fStandard) && (
699 (glVer >= GR_GL_VER(4,3)) ||
700 fExtensions.has("GL_ARB_invalidate_subdata"))) ||
701 (GR_IS_GR_GL_ES(fStandard) && (
702 (glVer >= GR_GL_VER(3,0)))) ||
703 (GR_IS_GR_WEBGL(fStandard) && (
704 (glVer >= GR_GL_VER(2,0))))) {
705 if (!fFunctions.fInvalidateFramebuffer ||
706 !fFunctions.fInvalidateSubFramebuffer) {
707 RETURN_FALSE_INTERFACE;
708 }
709 }
710
711 if ((GR_IS_GR_GL(fStandard) && (
712 (glVer >= GR_GL_VER(4,3)) ||
713 fExtensions.has("GL_ARB_ES2_compatibility"))) ||
714 GR_IS_GR_GL_ES(fStandard) ||
715 GR_IS_GR_WEBGL(fStandard)) {
716 if (!fFunctions.fGetShaderPrecisionFormat) {
717 RETURN_FALSE_INTERFACE;
718 }
719 }
720
721
722 // End autogenerated content
723 return true;
724 }
725
726 #if GR_TEST_UTILS
727
abandon() const728 void GrGLInterface::abandon() const {
729 const_cast<GrGLInterface*>(this)->fFunctions = GrGLInterface::Functions();
730 }
731
732 #endif // GR_TEST_UTILS
733