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

Unified Diff: Source/core/html/canvas/WebGL2RenderingContextBase.cpp

Issue 1190783007: Implemented getBufferSubData, fixed bindTransformFeedback conformance issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | public/platform/WebGraphicsContext3D.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/WebGL2RenderingContextBase.cpp
diff --git a/Source/core/html/canvas/WebGL2RenderingContextBase.cpp b/Source/core/html/canvas/WebGL2RenderingContextBase.cpp
index 96dacb33e080e01e8533be0d9772957caf3b7d4a..73963ac03302f8ecfec4700282f78e7884e43238 100644
--- a/Source/core/html/canvas/WebGL2RenderingContextBase.cpp
+++ b/Source/core/html/canvas/WebGL2RenderingContextBase.cpp
@@ -91,7 +91,14 @@ void WebGL2RenderingContextBase::getBufferSubData(GLenum target, GLintptr offset
if (isContextLost())
return;
- notImplemented();
+ void* mappedData = webContext()->mapBufferRange(target, offset, returnedData->byteLength(), GL_MAP_READ_BIT);
+
+ if (!mappedData)
+ return;
+
+ memcpy(returnedData->data(), mappedData, returnedData->byteLength());
+
+ webContext()->unmapBuffer(target);
}
void WebGL2RenderingContextBase::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
@@ -1269,8 +1276,10 @@ void WebGL2RenderingContextBase::bindTransformFeedback(GLenum target, WebGLTrans
bool deleted;
if (!checkObjectToBeBound("bindTransformFeedback", feedback, deleted))
return;
- if (deleted)
- feedback = 0;
+ if (deleted) {
+ synthesizeGLError(GL_INVALID_OPERATION, "bindTransformFeedback", "attempted to bind a deleted transform feedback object");
+ return;
+ }
if (target != GL_TRANSFORM_FEEDBACK) {
synthesizeGLError(GL_INVALID_ENUM, "bindTransformFeedback", "target must be TRANSFORM_FEEDBACK");
« no previous file with comments | « no previous file | public/platform/WebGraphicsContext3D.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698