diff options
author | 2014-05-05 12:32:37 +0000 | |
---|---|---|
committer | 2014-05-05 12:32:37 +0000 | |
commit | 160b478eed1dd4924a86a87fd60c91139e08ff71 (patch) | |
tree | e33d47f4047f613a97d93314a73351952a996b56 /src/gpu/gl/GrGLCreateNullInterface.cpp | |
parent | 889112012449b35132a9dc196b025c5f4145904a (diff) |
Add support for glMapBufferRange. Use glMapBufferRange and glMapBufferSubData.
BUG=skia:2402
Committed: http://code.google.com/p/skia/source/detail?r=14533
R=robertphillips@google.com, djsollen@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/243413002
git-svn-id: http://skia.googlecode.com/svn/trunk@14564 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl/GrGLCreateNullInterface.cpp')
-rw-r--r-- | src/gpu/gl/GrGLCreateNullInterface.cpp | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/src/gpu/gl/GrGLCreateNullInterface.cpp b/src/gpu/gl/GrGLCreateNullInterface.cpp index 2ef7659db7..6cfa8c29d0 100644 --- a/src/gpu/gl/GrGLCreateNullInterface.cpp +++ b/src/gpu/gl/GrGLCreateNullInterface.cpp @@ -186,8 +186,29 @@ GrGLvoid GR_GL_FUNCTION_TYPE nullGLDeleteBuffers(GrGLsizei n, const GrGLuint* id } } -GrGLvoid* GR_GL_FUNCTION_TYPE nullGLMapBuffer(GrGLenum target, GrGLenum access) { +GrGLvoid* GR_GL_FUNCTION_TYPE nullGLMapBufferRange(GrGLenum target, GrGLintptr offset, + GrGLsizeiptr length, GrGLbitfield access) { + GrGLuint id = 0; + switch (target) { + case GR_GL_ARRAY_BUFFER: + id = gCurrArrayBuffer; + break; + case GR_GL_ELEMENT_ARRAY_BUFFER: + id = gCurrElementArrayBuffer; + break; + } + if (id > 0) { + // We just ignore the offset and length here. + GrBufferObj* buffer = look_up(id); + SkASSERT(!buffer->mapped()); + buffer->setMapped(true); + return buffer->dataPtr(); + } + return NULL; +} + +GrGLvoid* GR_GL_FUNCTION_TYPE nullGLMapBuffer(GrGLenum target, GrGLenum access) { GrGLuint id = 0; switch (target) { case GR_GL_ARRAY_BUFFER: @@ -209,6 +230,11 @@ GrGLvoid* GR_GL_FUNCTION_TYPE nullGLMapBuffer(GrGLenum target, GrGLenum access) return NULL; // no buffer bound to target } +GrGLvoid GR_GL_FUNCTION_TYPE nullGLFlushMappedBufferRange(GrGLenum target, + GrGLintptr offset, + GrGLsizeiptr length) {} + + GrGLboolean GR_GL_FUNCTION_TYPE nullGLUnmapBuffer(GrGLenum target) { GrGLuint id = 0; switch (target) { @@ -304,6 +330,7 @@ const GrGLInterface* GrGLCreateNullInterface() { functions->fEndQuery = noOpGLEndQuery; functions->fFinish = noOpGLFinish; functions->fFlush = noOpGLFlush; + functions->fFlushMappedBufferRange = nullGLFlushMappedBufferRange; functions->fFrontFace = noOpGLFrontFace; functions->fGenBuffers = nullGLGenBuffers; functions->fGenerateMipmap = nullGLGenerateMipmap; @@ -329,6 +356,8 @@ const GrGLInterface* GrGLCreateNullInterface() { functions->fInsertEventMarker = noOpGLInsertEventMarker; functions->fLineWidth = noOpGLLineWidth; functions->fLinkProgram = noOpGLLinkProgram; + functions->fMapBuffer = nullGLMapBuffer; + functions->fMapBufferRange = nullGLMapBufferRange; functions->fPixelStorei = nullGLPixelStorei; functions->fPopGroupMarker = noOpGLPopGroupMarker; functions->fPushGroupMarker = noOpGLPushGroupMarker; @@ -368,6 +397,7 @@ const GrGLInterface* GrGLCreateNullInterface() { functions->fUniformMatrix2fv = noOpGLUniformMatrix2fv; functions->fUniformMatrix3fv = noOpGLUniformMatrix3fv; functions->fUniformMatrix4fv = noOpGLUniformMatrix4fv; + functions->fUnmapBuffer = nullGLUnmapBuffer; functions->fUseProgram = nullGLUseProgram; functions->fVertexAttrib4fv = noOpGLVertexAttrib4fv; functions->fVertexAttribPointer = noOpGLVertexAttribPointer; @@ -387,10 +417,8 @@ const GrGLInterface* GrGLCreateNullInterface() { functions->fRenderbufferStorageMultisample = noOpGLRenderbufferStorageMultisample; functions->fBlitFramebuffer = noOpGLBlitFramebuffer; functions->fResolveMultisampleFramebuffer = noOpGLResolveMultisampleFramebuffer; - functions->fMapBuffer = nullGLMapBuffer; functions->fMatrixLoadf = noOpGLMatrixLoadf; functions->fMatrixLoadIdentity = noOpGLMatrixLoadIdentity; - functions->fUnmapBuffer = nullGLUnmapBuffer; functions->fBindFragDataLocationIndexed = noOpGLBindFragDataLocationIndexed; interface->fExtensions.init(kGL_GrGLStandard, functions->fGetString, functions->fGetStringi, |