| 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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 } | 479 } |
| 480 | 480 |
| 481 if (fExtensions.has("GL_EXT_debug_marker")) { | 481 if (fExtensions.has("GL_EXT_debug_marker")) { |
| 482 if (NULL == fFunctions.fInsertEventMarker || | 482 if (NULL == fFunctions.fInsertEventMarker || |
| 483 NULL == fFunctions.fPushGroupMarker || | 483 NULL == fFunctions.fPushGroupMarker || |
| 484 NULL == fFunctions.fPopGroupMarker) { | 484 NULL == fFunctions.fPopGroupMarker) { |
| 485 RETURN_FALSE_INTERFACE | 485 RETURN_FALSE_INTERFACE |
| 486 } | 486 } |
| 487 } | 487 } |
| 488 | 488 |
| 489 #if 0 // This can be enabled once Chromium is updated to set these functions poi
nters. | 489 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) || |
| 490 if ((kGL_GrGLStandard == fStandard) || fExtensions.has("GL_ARB_invalidate_su
bdata")) { | 490 fExtensions.has("GL_ARB_invalidate_subdata")) { |
| 491 if (NULL == fFunctions.fInvalidateBufferData || | 491 if (NULL == fFunctions.fInvalidateBufferData || |
| 492 NULL == fFunctions.fInvalidateBufferSubData || | 492 NULL == fFunctions.fInvalidateBufferSubData || |
| 493 NULL == fFunctions.fInvalidateFramebuffer || | 493 NULL == fFunctions.fInvalidateFramebuffer || |
| 494 NULL == fFunctions.fInvalidateSubFramebuffer || | 494 NULL == fFunctions.fInvalidateSubFramebuffer || |
| 495 NULL == fFunctions.fInvalidateTexImage || | 495 NULL == fFunctions.fInvalidateTexImage || |
| 496 NULL == fFunctions.fInvalidateTexSubImage) { | 496 NULL == fFunctions.fInvalidateTexSubImage) { |
| 497 RETURN_FALSE_INTERFACE; | 497 RETURN_FALSE_INTERFACE; |
| 498 } | 498 } |
| 499 } else if (glVer >= GR_GL_VER(3,0)) { | 499 } else if (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) { |
| 500 // ES 3.0 adds the framebuffer functions but not the others. | 500 // ES 3.0 adds the framebuffer functions but not the others. |
| 501 if (NULL == fFunctions.fInvalidateFramebuffer || | 501 if (NULL == fFunctions.fInvalidateFramebuffer || |
| 502 NULL == fFunctions.fInvalidateSubFramebuffer) { | 502 NULL == fFunctions.fInvalidateSubFramebuffer) { |
| 503 RETURN_FALSE_INTERFACE; | 503 RETURN_FALSE_INTERFACE; |
| 504 } | 504 } |
| 505 } | 505 } |
| 506 | 506 |
| 507 if (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_CHROMIUM_map_sub"
)) { | 507 if (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_CHROMIUM_map_sub"
)) { |
| 508 if (NULL == fFunctions.fMapBufferSubData || | 508 if (NULL == fFunctions.fMapBufferSubData || |
| 509 NULL == fFunctions.fMapTexSubImage2D || | 509 NULL == fFunctions.fMapTexSubImage2D || |
| 510 NULL == fFunctions.fUnmapBufferSubData || | 510 NULL == fFunctions.fUnmapBufferSubData || |
| 511 NULL == fFunctions.fUnmapTexSubImage2D) { | 511 NULL == fFunctions.fUnmapTexSubImage2D) { |
| 512 RETURN_FALSE_INTERFACE; | 512 RETURN_FALSE_INTERFACE; |
| 513 } | 513 } |
| 514 } | 514 } |
| 515 #endif | |
| 516 | 515 |
| 516 // These functions are added to the 3.0 version of both GLES and GL. |
| 517 if (glVer >= GR_GL_VER(3,0) || |
| 518 (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_EXT_map_buffer_r
ange")) || |
| 519 (kGL_GrGLStandard == fStandard && fExtensions.has("GL_ARB_map_buffer_ran
ge"))) { |
| 520 if (NULL == fFunctions.fMapBufferRange || |
| 521 NULL == fFunctions.fFlushMappedBufferRange) { |
| 522 RETURN_FALSE_INTERFACE; |
| 523 } |
| 524 } |
| 517 return true; | 525 return true; |
| 518 } | 526 } |
| OLD | NEW |