Add EXT suffix to EXT_map_buffer_range references
This rearranges the code to use the non-suffixed entry point for ES
3.x contexts, and the suffixed entry point on ES 2.0 contexts that
have the extension.
R=robertphillips@google.com
Review URL: https://codereview.chromium.org/293993010
git-svn-id: http://skia.googlecode.com/svn/trunk@14823 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp b/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp
index 312299a..85341ac 100644
--- a/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp
+++ b/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp
@@ -193,15 +193,23 @@
#endif
-#if GL_ES_VERSION_3_0 || GL_EXT_map_buffer_range
- functions->fMapBufferRange = glMapBufferRange;
- functions->fFlushMappedBufferRange = glFlushMappedBufferRange;
+ if (version >= GR_GL_VER(3,0)) {
+#if GL_ES_VERSION_3_0
+ functions->fMapBufferRange = glMapBufferRange;
+ functions->fFlushMappedBufferRange = glFlushMappedBufferRange;
#else
- if (version >= GR_GL_VER(3,0) || extensions->has("GL_EXT_map_buffer_range")) {
functions->fMapBufferRange = (GrGLMapBufferRangeProc) eglGetProcAddress("glMapBufferRange");
functions->fFlushMappedBufferRange = (GrGLFlushMappedBufferRangeProc) eglGetProcAddress("glFlushMappedBufferRange");
- }
#endif
+ } else if (extensions->has("GL_EXT_map_buffer_range")) {
+#if GL_EXT_map_buffer_range
+ functions->fMapBufferRange = glMapBufferRangeEXT;
+ functions->fFlushMappedBufferRange = glFlushMappedBufferRangeEXT;
+#else
+ functions->fMapBufferRange = (GrGLMapBufferRangeProc) eglGetProcAddress("glMapBufferRangeEXT");
+ functions->fFlushMappedBufferRange = (GrGLFlushMappedBufferRangeProc) eglGetProcAddress("glFlushMappedBufferRangeEXT");
+#endif
+ }
if (extensions->has("GL_EXT_debug_marker")) {
functions->fInsertEventMarker = (GrGLInsertEventMarkerProc) eglGetProcAddress("glInsertEventMarker");