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_ES(fStandard) && (
337 fExtensions.has("GL_QCOM_tiled_rendering")))) {
338 if (!fFunctions.fEndTiling ||
339 !fFunctions.fStartTiling) {
340 RETURN_FALSE_INTERFACE;
341 }
342 }
343
344 if ((GR_IS_GR_GL(fStandard) && (
345 (glVer >= GR_GL_VER(3,2)) ||
346 fExtensions.has("GL_ARB_instanced_arrays"))) ||
347 (GR_IS_GR_GL_ES(fStandard) && (
348 (glVer >= GR_GL_VER(3,0)) ||
349 fExtensions.has("GL_EXT_instanced_arrays"))) ||
350 (GR_IS_GR_WEBGL(fStandard) && (
351 (glVer >= GR_GL_VER(2,0))))) {
352 if (!fFunctions.fVertexAttribDivisor) {
353 RETURN_FALSE_INTERFACE;
354 }
355 }
356
357 if ((GR_IS_GR_GL(fStandard) && (
358 (glVer >= GR_GL_VER(3,0)))) ||
359 (GR_IS_GR_GL_ES(fStandard) && (
360 (glVer >= GR_GL_VER(3,0)))) ||
361 (GR_IS_GR_WEBGL(fStandard) && (
362 (glVer >= GR_GL_VER(2,0))))) {
363 if (!fFunctions.fVertexAttribIPointer) {
364 RETURN_FALSE_INTERFACE;
365 }
366 }
367
368 if ((GR_IS_GR_GL(fStandard) && (
369 (glVer >= GR_GL_VER(3,0)) ||
370 fExtensions.has("GL_ARB_framebuffer_object") ||
371 fExtensions.has("GL_EXT_framebuffer_object"))) ||
372 GR_IS_GR_GL_ES(fStandard) ||
373 GR_IS_GR_WEBGL(fStandard)) {
374 if (!fFunctions.fBindFramebuffer ||
375 !fFunctions.fBindRenderbuffer ||
376 !fFunctions.fCheckFramebufferStatus ||
377 !fFunctions.fDeleteFramebuffers ||
378 !fFunctions.fDeleteRenderbuffers ||
379 !fFunctions.fFramebufferRenderbuffer ||
380 !fFunctions.fFramebufferTexture2D ||
381 !fFunctions.fGenFramebuffers ||
382 !fFunctions.fGenRenderbuffers ||
383 !fFunctions.fGenerateMipmap ||
384 !fFunctions.fGetFramebufferAttachmentParameteriv ||
385 !fFunctions.fGetRenderbufferParameteriv ||
386 !fFunctions.fRenderbufferStorage) {
387 RETURN_FALSE_INTERFACE;
388 }
389 }
390
391 if ((GR_IS_GR_GL(fStandard) && (
392 (glVer >= GR_GL_VER(3,0)) ||
393 fExtensions.has("GL_ARB_framebuffer_object") ||
394 fExtensions.has("GL_EXT_framebuffer_blit"))) ||
395 (GR_IS_GR_GL_ES(fStandard) && (
396 (glVer >= GR_GL_VER(3,0)) ||
397 fExtensions.has("GL_CHROMIUM_framebuffer_multisample") ||
398 fExtensions.has("GL_ANGLE_framebuffer_blit")))) {
399 if (!fFunctions.fBlitFramebuffer) {
400 RETURN_FALSE_INTERFACE;
401 }
402 }
403
404 if ((GR_IS_GR_GL(fStandard) && (
405 (glVer >= GR_GL_VER(3,0)) ||
406 fExtensions.has("GL_ARB_framebuffer_object") ||
407 fExtensions.has("GL_EXT_framebuffer_multisample"))) ||
408 (GR_IS_GR_GL_ES(fStandard) && (
409 (glVer >= GR_GL_VER(3,0)) ||
410 fExtensions.has("GL_CHROMIUM_framebuffer_multisample") ||
411 fExtensions.has("GL_ANGLE_framebuffer_multisample"))) ||
412 (GR_IS_GR_WEBGL(fStandard) && (
413 (glVer >= GR_GL_VER(2,0))))) {
414 if (!fFunctions.fRenderbufferStorageMultisample) {
415 RETURN_FALSE_INTERFACE;
416 }
417 }
418
419 if ((GR_IS_GR_GL_ES(fStandard) && (
420 fExtensions.has("GL_CHROMIUM_map_sub")))) {
421 if (!fFunctions.fMapBufferSubData ||
422 !fFunctions.fMapTexSubImage2D ||
423 !fFunctions.fUnmapBufferSubData ||
424 !fFunctions.fUnmapTexSubImage2D) {
425 RETURN_FALSE_INTERFACE;
426 }
427 }
428
429 if ((GR_IS_GR_GL_ES(fStandard) && (
430 fExtensions.has("GL_EXT_multisampled_render_to_texture") ||
431 fExtensions.has("GL_IMG_multisampled_render_to_texture")))) {
432 if (!fFunctions.fFramebufferTexture2DMultisample) {
433 RETURN_FALSE_INTERFACE;
434 }
435 }
436
437 if ((GR_IS_GR_GL_ES(fStandard) && (
438 fExtensions.has("GL_EXT_multisampled_render_to_texture")))) {
439 if (!fFunctions.fRenderbufferStorageMultisampleES2EXT) {
440 RETURN_FALSE_INTERFACE;
441 }
442 }
443
444 if ((GR_IS_GR_GL_ES(fStandard) && (
445 fExtensions.has("GL_IMG_multisampled_render_to_texture")))) {
446 if (!fFunctions.fRenderbufferStorageMultisampleES2EXT) {
447 RETURN_FALSE_INTERFACE;
448 }
449 }
450
451 if ((GR_IS_GR_GL_ES(fStandard) && (
452 fExtensions.has("GL_APPLE_framebuffer_multisample")))) {
453 if (!fFunctions.fResolveMultisampleFramebuffer ||
454 !fFunctions.fRenderbufferStorageMultisampleES2APPLE) {
455 RETURN_FALSE_INTERFACE;
456 }
457 }
458
459 if (GR_IS_GR_GL(fStandard) ||
460 (GR_IS_GR_GL_ES(fStandard) && (
461 fExtensions.has("GL_OES_mapbuffer")))) {
462 if (!fFunctions.fMapBuffer) {
463 RETURN_FALSE_INTERFACE;
464 }
465 }
466
467 if (GR_IS_GR_GL(fStandard) ||
468 (GR_IS_GR_GL_ES(fStandard) && (
469 (glVer >= GR_GL_VER(3,0)) ||
470 fExtensions.has("GL_OES_mapbuffer")))) {
471 if (!fFunctions.fUnmapBuffer) {
472 RETURN_FALSE_INTERFACE;
473 }
474 }
475
476 if ((GR_IS_GR_GL(fStandard) && (
477 (glVer >= GR_GL_VER(3,0)) ||
478 fExtensions.has("GL_ARB_map_buffer_range"))) ||
479 (GR_IS_GR_GL_ES(fStandard) && (
480 (glVer >= GR_GL_VER(3,0)) ||
481 fExtensions.has("GL_EXT_map_buffer_range")))) {
482 if (!fFunctions.fFlushMappedBufferRange ||
483 !fFunctions.fMapBufferRange) {
484 RETURN_FALSE_INTERFACE;
485 }
486 }
487
488 if ((GR_IS_GR_GL(fStandard) && (
489 fExtensions.has("GL_EXT_debug_marker"))) ||
490 (GR_IS_GR_GL_ES(fStandard) && (
491 fExtensions.has("GL_EXT_debug_marker")))) {
492 if (!fFunctions.fInsertEventMarker ||
493 !fFunctions.fPopGroupMarker ||
494 !fFunctions.fPushGroupMarker) {
495 RETURN_FALSE_INTERFACE;
496 }
497 }
498
499 if ((GR_IS_GR_GL(fStandard) && (
500 (glVer >= GR_GL_VER(4,3)) ||
501 fExtensions.has("GL_ARB_program_interface_query"))) ||
502 (GR_IS_GR_GL_ES(fStandard) && (
503 (glVer >= GR_GL_VER(3,1))))) {
504 if (!fFunctions.fGetProgramResourceLocation) {
505 RETURN_FALSE_INTERFACE;
506 }
507 }
508
509 if ((GR_IS_GR_GL(fStandard) && (
510 fExtensions.has("GL_NV_path_rendering"))) ||
511 (GR_IS_GR_GL_ES(fStandard) && (
512 fExtensions.has("GL_CHROMIUM_path_rendering") ||
513 fExtensions.has("GL_NV_path_rendering")))) {
514 if (!fFunctions.fMatrixLoadIdentity ||
515 !fFunctions.fMatrixLoadf) {
516 RETURN_FALSE_INTERFACE;
517 }
518 }
519
520 if ((GR_IS_GR_GL(fStandard) && (
521 fExtensions.has("GL_NV_path_rendering"))) ||
522 (GR_IS_GR_GL_ES(fStandard) && (
523 fExtensions.has("GL_CHROMIUM_path_rendering") ||
524 fExtensions.has("GL_NV_path_rendering")))) {
525 if (!fFunctions.fCoverFillPath ||
526 !fFunctions.fCoverFillPathInstanced ||
527 !fFunctions.fCoverStrokePath ||
528 !fFunctions.fCoverStrokePathInstanced ||
529 !fFunctions.fDeletePaths ||
530 !fFunctions.fGenPaths ||
531 !fFunctions.fIsPath ||
532 !fFunctions.fPathCommands ||
533 !fFunctions.fPathParameterf ||
534 !fFunctions.fPathParameteri ||
535 !fFunctions.fPathStencilFunc ||
536 !fFunctions.fStencilFillPath ||
537 !fFunctions.fStencilFillPathInstanced ||
538 !fFunctions.fStencilStrokePath ||
539 !fFunctions.fStencilStrokePathInstanced) {
540 RETURN_FALSE_INTERFACE;
541 }
542 }
543
544 if ((GR_IS_GR_GL_ES(fStandard) && (
545 fExtensions.has("GL_CHROMIUM_path_rendering")))) {
546 if (!fFunctions.fBindFragmentInputLocation) {
547 RETURN_FALSE_INTERFACE;
548 }
549 }
550
551 if ((GR_IS_GR_GL(fStandard) && (
552 fExtensions.has("GL_NV_framebuffer_mixed_samples"))) ||
553 (GR_IS_GR_GL_ES(fStandard) && (
554 fExtensions.has("GL_CHROMIUM_framebuffer_mixed_samples") ||
555 fExtensions.has("GL_NV_framebuffer_mixed_samples")))) {
556 if (!fFunctions.fCoverageModulation) {
557 RETURN_FALSE_INTERFACE;
558 }
559 }
560
561 if ((GR_IS_GR_GL(fStandard) && (
562 (glVer >= GR_GL_VER(4,3)) ||
563 fExtensions.has("GL_KHR_debug"))) ||
564 (GR_IS_GR_GL_ES(fStandard) && (
565 fExtensions.has("GL_KHR_debug")))) {
566 if (!fFunctions.fDebugMessageCallback ||
567 !fFunctions.fDebugMessageControl ||
568 !fFunctions.fDebugMessageInsert ||
569 !fFunctions.fGetDebugMessageLog ||
570 !fFunctions.fObjectLabel ||
571 !fFunctions.fPopDebugGroup ||
572 !fFunctions.fPushDebugGroup) {
573 RETURN_FALSE_INTERFACE;
574 }
575 }
576
577 if ((GR_IS_GR_GL_ES(fStandard) && (
578 fExtensions.has("GL_CHROMIUM_bind_uniform_location")))) {
579 if (!fFunctions.fBindUniformLocation) {
580 RETURN_FALSE_INTERFACE;
581 }
582 }
583
584 if ((GR_IS_GR_GL(fStandard) && (
585 fExtensions.has("GL_EXT_window_rectangles"))) ||
586 (GR_IS_GR_GL_ES(fStandard) && (
587 fExtensions.has("GL_EXT_window_rectangles")))) {
588 if (!fFunctions.fWindowRectangles) {
589 RETURN_FALSE_INTERFACE;
590 }
591 }
592
593 if ((GR_IS_GR_GL(fStandard) && (
594 (glVer >= GR_GL_VER(3,2)) ||
595 fExtensions.has("GL_ARB_sync"))) ||
596 (GR_IS_GR_GL_ES(fStandard) && (
597 (glVer >= GR_GL_VER(3,0)) ||
598 fExtensions.has("GL_APPLE_sync"))) ||
599 (GR_IS_GR_WEBGL(fStandard) && (
600 (glVer >= GR_GL_VER(2,0))))) {
601 if (!fFunctions.fClientWaitSync ||
602 !fFunctions.fDeleteSync ||
603 !fFunctions.fFenceSync ||
604 !fFunctions.fIsSync ||
605 !fFunctions.fWaitSync) {
606 RETURN_FALSE_INTERFACE;
607 }
608 }
609
610 if ((GR_IS_GR_GL(fStandard) && (
611 (glVer >= GR_GL_VER(4,2)) ||
612 fExtensions.has("GL_ARB_internalformat_query"))) ||
613 (GR_IS_GR_GL_ES(fStandard) && (
614 (glVer >= GR_GL_VER(3,0))))) {
615 if (!fFunctions.fGetInternalformativ) {
616 RETURN_FALSE_INTERFACE;
617 }
618 }
619
620 if ((GR_IS_GR_GL(fStandard) && (
621 (glVer >= GR_GL_VER(4,1)))) ||
622 (GR_IS_GR_GL_ES(fStandard) && (
623 (glVer >= GR_GL_VER(3,0)) ||
624 fExtensions.has("GL_OES_get_program_binary")))) {
625 if (!fFunctions.fGetProgramBinary ||
626 !fFunctions.fProgramBinary) {
627 RETURN_FALSE_INTERFACE;
628 }
629 }
630
631 if ((GR_IS_GR_GL(fStandard) && (
632 (glVer >= GR_GL_VER(4,1)))) ||
633 (GR_IS_GR_GL_ES(fStandard) && (
634 (glVer >= GR_GL_VER(3,0))))) {
635 if (!fFunctions.fProgramParameteri) {
636 RETURN_FALSE_INTERFACE;
637 }
638 }
639
640 if ((GR_IS_GR_GL(fStandard) && (
641 (glVer >= GR_GL_VER(3,2)) ||
642 fExtensions.has("GL_ARB_sampler_objects"))) ||
643 (GR_IS_GR_GL_ES(fStandard) && (
644 (glVer >= GR_GL_VER(3,0)))) ||
645 (GR_IS_GR_WEBGL(fStandard) && (
646 (glVer >= GR_GL_VER(2,0))))) {
647 if (!fFunctions.fBindSampler ||
648 !fFunctions.fDeleteSamplers ||
649 !fFunctions.fGenSamplers ||
650 !fFunctions.fSamplerParameteri ||
651 !fFunctions.fSamplerParameteriv) {
652 RETURN_FALSE_INTERFACE;
653 }
654 }
655
656 if (GR_IS_GR_GL(fStandard)) {
657 if (!fFunctions.fGetQueryObjectiv) {
658 RETURN_FALSE_INTERFACE;
659 }
660 }
661
662 if (GR_IS_GR_GL(fStandard) ||
663 (GR_IS_GR_GL_ES(fStandard) && (
664 (glVer >= GR_GL_VER(3,0)) ||
665 fExtensions.has("GL_EXT_occlusion_query_boolean")))) {
666 #if GR_TEST_UTILS
667 if (!fFunctions.fBeginQuery ||
668 !fFunctions.fDeleteQueries ||
669 !fFunctions.fEndQuery ||
670 !fFunctions.fGenQueries ||
671 !fFunctions.fGetQueryObjectuiv ||
672 !fFunctions.fGetQueryiv) {
673 RETURN_FALSE_INTERFACE;
674 }
675 #endif
676 // all functions were marked optional or test_only
677 }
678
679 if ((GR_IS_GR_GL(fStandard) && (
680 (glVer >= GR_GL_VER(3,3)) ||
681 fExtensions.has("GL_ARB_timer_query") ||
682 fExtensions.has("GL_EXT_timer_query")))) {
683 if (!fFunctions.fGetQueryObjecti64v ||
684 !fFunctions.fGetQueryObjectui64v) {
685 RETURN_FALSE_INTERFACE;
686 }
687 }
688
689 if ((GR_IS_GR_GL(fStandard) && (
690 (glVer >= GR_GL_VER(3,3)) ||
691 fExtensions.has("GL_ARB_timer_query")))) {
692 if (!fFunctions.fQueryCounter) {
693 RETURN_FALSE_INTERFACE;
694 }
695 }
696
697 if ((GR_IS_GR_GL(fStandard) && (
698 (glVer >= GR_GL_VER(4,3)) ||
699 fExtensions.has("GL_ARB_invalidate_subdata")))) {
700 if (!fFunctions.fInvalidateBufferData ||
701 !fFunctions.fInvalidateBufferSubData ||
702 !fFunctions.fInvalidateTexImage ||
703 !fFunctions.fInvalidateTexSubImage) {
704 RETURN_FALSE_INTERFACE;
705 }
706 }
707
708 if ((GR_IS_GR_GL(fStandard) && (
709 (glVer >= GR_GL_VER(4,3)) ||
710 fExtensions.has("GL_ARB_invalidate_subdata"))) ||
711 (GR_IS_GR_GL_ES(fStandard) && (
712 (glVer >= GR_GL_VER(3,0)))) ||
713 (GR_IS_GR_WEBGL(fStandard) && (
714 (glVer >= GR_GL_VER(2,0))))) {
715 if (!fFunctions.fInvalidateFramebuffer ||
716 !fFunctions.fInvalidateSubFramebuffer) {
717 RETURN_FALSE_INTERFACE;
718 }
719 }
720
721 if ((GR_IS_GR_GL(fStandard) && (
722 (glVer >= GR_GL_VER(4,3)) ||
723 fExtensions.has("GL_ARB_ES2_compatibility"))) ||
724 GR_IS_GR_GL_ES(fStandard) ||
725 GR_IS_GR_WEBGL(fStandard)) {
726 if (!fFunctions.fGetShaderPrecisionFormat) {
727 RETURN_FALSE_INTERFACE;
728 }
729 }
730
731
732 // End autogenerated content
733 return true;
734 }
735
736 #if GR_TEST_UTILS
737
abandon() const738 void GrGLInterface::abandon() const {
739 const_cast<GrGLInterface*>(this)->fFunctions = GrGLInterface::Functions();
740 }
741
742 #endif // GR_TEST_UTILS
743