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

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

Issue 2322943002: Generate INVALID_OPERATION error when attempting to bind a deleted object (Closed)
Patch Set: Solve merge conflict Created 4 years, 3 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
Index: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
index f04ba1a1ad2af29ce141b7de41f55f49e2d149a4..ad89f564747c4d18647836e4a2494075ab290dd6 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
@@ -2414,8 +2414,10 @@ void WebGL2RenderingContextBase::bindBufferBase(GLenum target, GLuint index, Web
bool deleted;
if (!checkObjectToBeBound("bindBufferBase", buffer, deleted))
return;
- if (deleted)
- buffer = 0;
+ if (deleted) {
+ synthesizeGLError(GL_INVALID_OPERATION, "bindBufferBase", "attempt to bind a deleted buffer");
+ return;
+ }
if (!validateAndUpdateBufferBindBaseTarget("bindBufferBase", target, index, buffer))
return;
@@ -2429,8 +2431,10 @@ void WebGL2RenderingContextBase::bindBufferRange(GLenum target, GLuint index, We
bool deleted;
if (!checkObjectToBeBound("bindBufferRange", buffer, deleted))
return;
- if (deleted)
- buffer = 0;
+ if (deleted) {
+ synthesizeGLError(GL_INVALID_OPERATION, "bindBufferRange", "attempt to bind a deleted buffer");
+ return;
+ }
if (!validateValueFitNonNegInt32("bindBufferRange", "offset", offset)
|| !validateValueFitNonNegInt32("bindBufferRange", "size", size)) {
return;
@@ -2731,8 +2735,10 @@ void WebGL2RenderingContextBase::bindFramebuffer(GLenum target, WebGLFramebuffer
if (!checkObjectToBeBound("bindFramebuffer", buffer, deleted))
return;
- if (deleted)
- buffer = 0;
+ if (deleted) {
+ synthesizeGLError(GL_INVALID_OPERATION, "bindFramebuffer", "attempt to bind a deleted framebuffer");
+ return;
+ }
switch (target) {
case GL_DRAW_FRAMEBUFFER:

Powered by Google App Engine
This is Rietveld 408576698