OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #include "gl/GrGLInterface.h" | 9 #include "gl/GrGLInterface.h" |
10 #include "gl/GrGLExtensions.h" | 10 #include "gl/GrGLExtensions.h" |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 } | 473 } |
474 | 474 |
475 if (fExtensions.has("GL_EXT_debug_marker")) { | 475 if (fExtensions.has("GL_EXT_debug_marker")) { |
476 if (NULL == fFunctions.fInsertEventMarker || | 476 if (NULL == fFunctions.fInsertEventMarker || |
477 NULL == fFunctions.fPushGroupMarker || | 477 NULL == fFunctions.fPushGroupMarker || |
478 NULL == fFunctions.fPopGroupMarker) { | 478 NULL == fFunctions.fPopGroupMarker) { |
479 RETURN_FALSE_INTERFACE | 479 RETURN_FALSE_INTERFACE |
480 } | 480 } |
481 } | 481 } |
482 | 482 |
483 #if 0 // This can be enabled once Chromium is updated to set these functions poi
nters. | 483 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) || |
484 if ((kGL_GrGLStandard == fStandard) || fExtensions.has("GL_ARB_invalidate_su
bdata")) { | 484 fExtensions.has("GL_ARB_invalidate_subdata")) { |
485 if (NULL == fFunctions.fInvalidateBufferData || | 485 if (NULL == fFunctions.fInvalidateBufferData || |
486 NULL == fFunctions.fInvalidateBufferSubData || | 486 NULL == fFunctions.fInvalidateBufferSubData || |
487 NULL == fFunctions.fInvalidateFramebuffer || | 487 NULL == fFunctions.fInvalidateFramebuffer || |
488 NULL == fFunctions.fInvalidateSubFramebuffer || | 488 NULL == fFunctions.fInvalidateSubFramebuffer || |
489 NULL == fFunctions.fInvalidateTexImage || | 489 NULL == fFunctions.fInvalidateTexImage || |
490 NULL == fFunctions.fInvalidateTexSubImage) { | 490 NULL == fFunctions.fInvalidateTexSubImage) { |
491 RETURN_FALSE_INTERFACE; | 491 RETURN_FALSE_INTERFACE; |
492 } | 492 } |
493 } else if (glVer >= GR_GL_VER(3,0)) { | 493 } else if (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) { |
494 // ES 3.0 adds the framebuffer functions but not the others. | 494 // ES 3.0 adds the framebuffer functions but not the others. |
495 if (NULL == fFunctions.fInvalidateFramebuffer || | 495 if (NULL == fFunctions.fInvalidateFramebuffer || |
496 NULL == fFunctions.fInvalidateSubFramebuffer) { | 496 NULL == fFunctions.fInvalidateSubFramebuffer) { |
497 RETURN_FALSE_INTERFACE; | 497 RETURN_FALSE_INTERFACE; |
498 } | 498 } |
499 } | 499 } |
500 | 500 |
501 if (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_CHROMIUM_map_sub"
)) { | 501 if (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_CHROMIUM_map_sub"
)) { |
502 if (NULL == fFunctions.fMapBufferSubData || | 502 if (NULL == fFunctions.fMapBufferSubData || |
503 NULL == fFunctions.fMapTexSubImage2D || | 503 NULL == fFunctions.fMapTexSubImage2D || |
504 NULL == fFunctions.fUnmapBufferSubData || | 504 NULL == fFunctions.fUnmapBufferSubData || |
505 NULL == fFunctions.fUnmapTexSubImage2D) { | 505 NULL == fFunctions.fUnmapTexSubImage2D) { |
506 RETURN_FALSE_INTERFACE; | 506 RETURN_FALSE_INTERFACE; |
507 } | 507 } |
508 } | 508 } |
509 #endif | |
510 | 509 |
| 510 // These functions are added to the 3.0 version of both GLES and GL. |
| 511 if (glVer >= GR_GL_VER(3,0) || |
| 512 (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_EXT_map_buffer_r
ange")) || |
| 513 (kGL_GrGLStandard == fStandard && fExtensions.has("GL_ARB_map_buffer_ran
ge"))) { |
| 514 if (NULL == fFunctions.fMapBufferRange || |
| 515 NULL == fFunctions.fFlushMappedBufferRange) { |
| 516 RETURN_FALSE_INTERFACE; |
| 517 } |
| 518 } |
511 return true; | 519 return true; |
512 } | 520 } |
OLD | NEW |