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

Side by Side Diff: src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp

Issue 243413002: Add support for glMapBufferRange. Use glMapBufferRange and glMapBufferSubData. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase to tot Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gpu/gl/GrGLInterface.cpp ('k') | src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 functions->fGenTextures = glGenTextures; 68 functions->fGenTextures = glGenTextures;
69 functions->fGenVertexArrays = glGenVertexArraysOES; 69 functions->fGenVertexArrays = glGenVertexArraysOES;
70 functions->fGetBufferParameteriv = glGetBufferParameteriv; 70 functions->fGetBufferParameteriv = glGetBufferParameteriv;
71 functions->fGetError = glGetError; 71 functions->fGetError = glGetError;
72 functions->fGetIntegerv = glGetIntegerv; 72 functions->fGetIntegerv = glGetIntegerv;
73 functions->fGetProgramInfoLog = glGetProgramInfoLog; 73 functions->fGetProgramInfoLog = glGetProgramInfoLog;
74 functions->fGetProgramiv = glGetProgramiv; 74 functions->fGetProgramiv = glGetProgramiv;
75 functions->fGetShaderInfoLog = glGetShaderInfoLog; 75 functions->fGetShaderInfoLog = glGetShaderInfoLog;
76 functions->fGetShaderiv = glGetShaderiv; 76 functions->fGetShaderiv = glGetShaderiv;
77 functions->fGetString = glGetString; 77 functions->fGetString = glGetString;
78 #if GL_ES_VERSION_30 78 #if GL_ES_VERSION_3_0
79 functions->fGetStringi = glGetStringi; 79 functions->fGetStringi = glGetStringi;
80 #else 80 #else
81 functions->fGetStringi = (GrGLGetStringiProc) eglGetProcAddress("glGetString i"); 81 functions->fGetStringi = (GrGLGetStringiProc) eglGetProcAddress("glGetString i");
82 #endif 82 #endif
83 functions->fGetUniformLocation = glGetUniformLocation; 83 functions->fGetUniformLocation = glGetUniformLocation;
84 functions->fLineWidth = glLineWidth; 84 functions->fLineWidth = glLineWidth;
85 functions->fLinkProgram = glLinkProgram; 85 functions->fLinkProgram = glLinkProgram;
86 functions->fPixelStorei = glPixelStorei; 86 functions->fPixelStorei = glPixelStorei;
87 functions->fReadPixels = glReadPixels; 87 functions->fReadPixels = glReadPixels;
88 functions->fScissor = glScissor; 88 functions->fScissor = glScissor;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 functions->fFramebufferTexture2DMultisample = (GrGLFramebufferTexture2DM ultisampleProc) eglGetProcAddress("glFramebufferTexture2DMultisampleIMG"); 176 functions->fFramebufferTexture2DMultisample = (GrGLFramebufferTexture2DM ultisampleProc) eglGetProcAddress("glFramebufferTexture2DMultisampleIMG");
177 functions->fRenderbufferStorageMultisampleES2EXT = (GrGLRenderbufferStor ageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisampleIMG"); 177 functions->fRenderbufferStorageMultisampleES2EXT = (GrGLRenderbufferStor ageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisampleIMG");
178 #endif 178 #endif
179 } 179 }
180 180
181 functions->fGenFramebuffers = glGenFramebuffers; 181 functions->fGenFramebuffers = glGenFramebuffers;
182 functions->fGenRenderbuffers = glGenRenderbuffers; 182 functions->fGenRenderbuffers = glGenRenderbuffers;
183 functions->fGetFramebufferAttachmentParameteriv = glGetFramebufferAttachment Parameteriv; 183 functions->fGetFramebufferAttachmentParameteriv = glGetFramebufferAttachment Parameteriv;
184 functions->fGetRenderbufferParameteriv = glGetRenderbufferParameteriv; 184 functions->fGetRenderbufferParameteriv = glGetRenderbufferParameteriv;
185 functions->fRenderbufferStorage = glRenderbufferStorage; 185 functions->fRenderbufferStorage = glRenderbufferStorage;
186
186 #if GL_OES_mapbuffer 187 #if GL_OES_mapbuffer
187 functions->fMapBuffer = glMapBufferOES; 188 functions->fMapBuffer = glMapBufferOES;
188 functions->fUnmapBuffer = glUnmapBufferOES; 189 functions->fUnmapBuffer = glUnmapBufferOES;
189 #else 190 #else
190 functions->fMapBuffer = (GrGLMapBufferProc) eglGetProcAddress("glMapBufferOE S"); 191 functions->fMapBuffer = (GrGLMapBufferProc) eglGetProcAddress("glMapBufferOE S");
191 functions->fUnmapBuffer = (GrGLUnmapBufferProc) eglGetProcAddress("glUnmapBu fferOES"); 192 functions->fUnmapBuffer = (GrGLUnmapBufferProc) eglGetProcAddress("glUnmapBu fferOES");
193
194 #endif
195
196 #if GL_ES_VERSION_3_0 || GL_EXT_map_buffer_range
197 functions->fMapBufferRange = glMapBufferRange;
198 functions->fFlushMappedBufferRange = glFlushMappedBufferRange;
199 #else
200 if (version >= GR_GL_VER(3,0) || extensions->has("GL_EXT_map_buffer_range")) {
201 functions->fMapBufferRange = (GrGLMapBufferRangeProc) eglGetProcAddress( "glMapBufferRange");
202 functions->fFlushMappedBufferRange = (GrGLFlushMappedBufferRangeProc) eg lGetProcAddress("glFlushMappedBufferRange");
203 }
192 #endif 204 #endif
193 205
194 if (extensions->has("GL_EXT_debug_marker")) { 206 if (extensions->has("GL_EXT_debug_marker")) {
195 functions->fInsertEventMarker = (GrGLInsertEventMarkerProc) eglGetProcAd dress("glInsertEventMarker"); 207 functions->fInsertEventMarker = (GrGLInsertEventMarkerProc) eglGetProcAd dress("glInsertEventMarker");
196 functions->fPushGroupMarker = (GrGLInsertEventMarkerProc) eglGetProcAddr ess("glPushGroupMarker"); 208 functions->fPushGroupMarker = (GrGLInsertEventMarkerProc) eglGetProcAddr ess("glPushGroupMarker");
197 functions->fPopGroupMarker = (GrGLPopGroupMarkerProc) eglGetProcAddress( "glPopGroupMarker"); 209 functions->fPopGroupMarker = (GrGLPopGroupMarkerProc) eglGetProcAddress( "glPopGroupMarker");
198 // The below check is here because a device has been found that has the extension string but 210 // The below check is here because a device has been found that has the extension string but
199 // returns NULL from the eglGetProcAddress for the functions 211 // returns NULL from the eglGetProcAddress for the functions
200 if (NULL == functions->fInsertEventMarker || 212 if (NULL == functions->fInsertEventMarker ||
201 NULL == functions->fPushGroupMarker || 213 NULL == functions->fPushGroupMarker ||
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 interface->fExtensions.swap(&extensions); 258 interface->fExtensions.swap(&extensions);
247 } 259 }
248 260
249 return interface; 261 return interface;
250 } else if (kGL_GrGLStandard == standard) { 262 } else if (kGL_GrGLStandard == standard) {
251 return create_desktop_interface(); 263 return create_desktop_interface();
252 } 264 }
253 265
254 return NULL; 266 return NULL;
255 } 267 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLInterface.cpp ('k') | src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698