Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Unified Diff: src/gpu/gl/GrGLInterface.cpp

Issue 243413002: Add support for glMapBufferRange. Use glMapBufferRange and glMapBufferSubData. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix assert Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/gl/GrGLInterface.cpp
diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp
index 5bf0efb7671004b6e80a3948a8613c13e73af3f2..3029914f0941aa023bd2b6cdd4f0592b20397159 100644
--- a/src/gpu/gl/GrGLInterface.cpp
+++ b/src/gpu/gl/GrGLInterface.cpp
@@ -480,8 +480,8 @@ bool GrGLInterface::validate() const {
}
}
-#if 0 // This can be enabled once Chromium is updated to set these functions pointers.
- if ((kGL_GrGLStandard == fStandard) || fExtensions.has("GL_ARB_invalidate_subdata")) {
+ if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) ||
+ fExtensions.has("GL_ARB_invalidate_subdata")) {
if (NULL == fFunctions.fInvalidateBufferData ||
NULL == fFunctions.fInvalidateBufferSubData ||
NULL == fFunctions.fInvalidateFramebuffer ||
@@ -490,7 +490,7 @@ bool GrGLInterface::validate() const {
NULL == fFunctions.fInvalidateTexSubImage) {
RETURN_FALSE_INTERFACE;
}
- } else if (glVer >= GR_GL_VER(3,0)) {
+ } else if (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) {
// ES 3.0 adds the framebuffer functions but not the others.
if (NULL == fFunctions.fInvalidateFramebuffer ||
NULL == fFunctions.fInvalidateSubFramebuffer) {
@@ -506,7 +506,15 @@ bool GrGLInterface::validate() const {
RETURN_FALSE_INTERFACE;
}
}
-#endif
+ // These functions are added to the 3.0 version of both GLES and GL.
+ if (glVer >= GR_GL_VER(3,0) ||
+ (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_EXT_map_buffer_range")) ||
+ (kGL_GrGLStandard == fStandard && fExtensions.has("GL_ARB_map_buffer_range"))) {
+ if (NULL == fFunctions.fMapBufferRange ||
+ NULL == fFunctions.fFlushMappedBufferRange) {
+ RETURN_FALSE_INTERFACE;
+ }
+ }
return true;
}

Powered by Google App Engine
This is Rietveld 408576698