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

Unified Diff: Source/modules/webgl/WebGL2RenderingContextBase.cpp

Issue 1317493003: Support ES 3.0 constants for bufferData's usage argument. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | « Source/modules/webgl/WebGL2RenderingContextBase.h ('k') | Source/modules/webgl/WebGLRenderingContextBase.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webgl/WebGL2RenderingContextBase.cpp
diff --git a/Source/modules/webgl/WebGL2RenderingContextBase.cpp b/Source/modules/webgl/WebGL2RenderingContextBase.cpp
index 234cbd6fbd2a8383012c72629f347131e8395dbd..fa95cfa7c3d154cb2a815963c1ec4cbbca891465 100644
--- a/Source/modules/webgl/WebGL2RenderingContextBase.cpp
+++ b/Source/modules/webgl/WebGL2RenderingContextBase.cpp
@@ -1594,9 +1594,13 @@ void WebGL2RenderingContextBase::resumeTransformFeedback()
void WebGL2RenderingContextBase::bindBufferBase(GLenum target, GLuint index, WebGLBuffer* buffer)
{
- if (isContextLost() || !validateWebGLObject("bindBufferBase", buffer))
+ if (isContextLost())
return;
-
+ bool deleted;
+ if (!checkObjectToBeBound("bindBufferBase", buffer, deleted))
+ return;
+ if (deleted)
+ buffer = 0;
Zhenyao Mo 2015/08/31 18:30:56 By the way, the spec says "If the buffer object na
Ken Russell (switch to Gerrit) 2015/08/31 18:41:53 It seems to me there isn't any difference in behav
webContext()->bindBufferBase(target, index, objectOrZero(buffer));
}
@@ -2450,6 +2454,21 @@ WebGLBuffer* WebGL2RenderingContextBase::validateBufferDataTarget(const char* fu
return buffer;
}
+bool WebGL2RenderingContextBase::validateBufferDataUsage(const char* functionName, GLenum usage)
+{
+ switch (usage) {
+ case GL_STREAM_READ:
+ case GL_STREAM_COPY:
+ case GL_STATIC_READ:
+ case GL_STATIC_COPY:
+ case GL_DYNAMIC_READ:
+ case GL_DYNAMIC_COPY:
+ return true;
+ default:
+ return WebGLRenderingContextBase::validateBufferDataUsage(functionName, usage);
+ }
+}
+
void WebGL2RenderingContextBase::removeBoundBuffer(WebGLBuffer* buffer)
{
if (m_boundCopyReadBuffer == buffer)
« no previous file with comments | « Source/modules/webgl/WebGL2RenderingContextBase.h ('k') | Source/modules/webgl/WebGLRenderingContextBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698