| OLD | NEW |
| 1 // Modified from chromium/src/webkit/glue/gl_bindings_skia_cmd_buffer.cc | 1 // Modified from chromium/src/webkit/glue/gl_bindings_skia_cmd_buffer.cc |
| 2 | 2 |
| 3 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 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 #include "gl/GrGLInterface.h" | 7 #include "gl/GrGLInterface.h" |
| 8 #include "gl/GrGLAssembleInterface.h" | 8 #include "gl/GrGLAssembleInterface.h" |
| 9 #include "gl/GrGLExtensions.h" | 9 #include "gl/GrGLExtensions.h" |
| 10 #include "gl/GrGLUtil.h" | 10 #include "gl/GrGLUtil.h" |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 186 |
| 187 #if GL_OES_mapbuffer | 187 #if GL_OES_mapbuffer |
| 188 functions->fMapBuffer = glMapBufferOES; | 188 functions->fMapBuffer = glMapBufferOES; |
| 189 functions->fUnmapBuffer = glUnmapBufferOES; | 189 functions->fUnmapBuffer = glUnmapBufferOES; |
| 190 #else | 190 #else |
| 191 functions->fMapBuffer = (GrGLMapBufferProc) eglGetProcAddress("glMapBufferOE
S"); | 191 functions->fMapBuffer = (GrGLMapBufferProc) eglGetProcAddress("glMapBufferOE
S"); |
| 192 functions->fUnmapBuffer = (GrGLUnmapBufferProc) eglGetProcAddress("glUnmapBu
fferOES"); | 192 functions->fUnmapBuffer = (GrGLUnmapBufferProc) eglGetProcAddress("glUnmapBu
fferOES"); |
| 193 | 193 |
| 194 #endif | 194 #endif |
| 195 | 195 |
| 196 #if GL_ES_VERSION_3_0 || GL_EXT_map_buffer_range | 196 if (version >= GR_GL_VER(3,0)) { |
| 197 functions->fMapBufferRange = glMapBufferRange; | 197 #if GL_ES_VERSION_3_0 |
| 198 functions->fFlushMappedBufferRange = glFlushMappedBufferRange; | 198 functions->fMapBufferRange = glMapBufferRange; |
| 199 functions->fFlushMappedBufferRange = glFlushMappedBufferRange; |
| 199 #else | 200 #else |
| 200 if (version >= GR_GL_VER(3,0) || extensions->has("GL_EXT_map_buffer_range"))
{ | |
| 201 functions->fMapBufferRange = (GrGLMapBufferRangeProc) eglGetProcAddress(
"glMapBufferRange"); | 201 functions->fMapBufferRange = (GrGLMapBufferRangeProc) eglGetProcAddress(
"glMapBufferRange"); |
| 202 functions->fFlushMappedBufferRange = (GrGLFlushMappedBufferRangeProc) eg
lGetProcAddress("glFlushMappedBufferRange"); | 202 functions->fFlushMappedBufferRange = (GrGLFlushMappedBufferRangeProc) eg
lGetProcAddress("glFlushMappedBufferRange"); |
| 203 #endif |
| 204 } else if (extensions->has("GL_EXT_map_buffer_range")) { |
| 205 #if GL_EXT_map_buffer_range |
| 206 functions->fMapBufferRange = glMapBufferRangeEXT; |
| 207 functions->fFlushMappedBufferRange = glFlushMappedBufferRangeEXT; |
| 208 #else |
| 209 functions->fMapBufferRange = (GrGLMapBufferRangeProc) eglGetProcAddress(
"glMapBufferRangeEXT"); |
| 210 functions->fFlushMappedBufferRange = (GrGLFlushMappedBufferRangeProc) eg
lGetProcAddress("glFlushMappedBufferRangeEXT"); |
| 211 #endif |
| 203 } | 212 } |
| 204 #endif | |
| 205 | 213 |
| 206 if (extensions->has("GL_EXT_debug_marker")) { | 214 if (extensions->has("GL_EXT_debug_marker")) { |
| 207 functions->fInsertEventMarker = (GrGLInsertEventMarkerProc) eglGetProcAd
dress("glInsertEventMarker"); | 215 functions->fInsertEventMarker = (GrGLInsertEventMarkerProc) eglGetProcAd
dress("glInsertEventMarker"); |
| 208 functions->fPushGroupMarker = (GrGLInsertEventMarkerProc) eglGetProcAddr
ess("glPushGroupMarker"); | 216 functions->fPushGroupMarker = (GrGLInsertEventMarkerProc) eglGetProcAddr
ess("glPushGroupMarker"); |
| 209 functions->fPopGroupMarker = (GrGLPopGroupMarkerProc) eglGetProcAddress(
"glPopGroupMarker"); | 217 functions->fPopGroupMarker = (GrGLPopGroupMarkerProc) eglGetProcAddress(
"glPopGroupMarker"); |
| 210 // The below check is here because a device has been found that has the
extension string but | 218 // The below check is here because a device has been found that has the
extension string but |
| 211 // returns NULL from the eglGetProcAddress for the functions | 219 // returns NULL from the eglGetProcAddress for the functions |
| 212 if (NULL == functions->fInsertEventMarker || | 220 if (NULL == functions->fInsertEventMarker || |
| 213 NULL == functions->fPushGroupMarker || | 221 NULL == functions->fPushGroupMarker || |
| 214 NULL == functions->fPopGroupMarker) { | 222 NULL == functions->fPopGroupMarker) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 interface->fExtensions.swap(&extensions); | 266 interface->fExtensions.swap(&extensions); |
| 259 } | 267 } |
| 260 | 268 |
| 261 return interface; | 269 return interface; |
| 262 } else if (kGL_GrGLStandard == standard) { | 270 } else if (kGL_GrGLStandard == standard) { |
| 263 return create_desktop_interface(); | 271 return create_desktop_interface(); |
| 264 } | 272 } |
| 265 | 273 |
| 266 return NULL; | 274 return NULL; |
| 267 } | 275 } |
| OLD | NEW |