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

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

Issue 17230006: Implement WEBGL_shared_resources Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | « Source/core/html/canvas/WebGLFramebuffer.h ('k') | Source/core/html/canvas/WebGLObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/WebGLFramebuffer.cpp
diff --git a/Source/core/html/canvas/WebGLFramebuffer.cpp b/Source/core/html/canvas/WebGLFramebuffer.cpp
index 4d622cfaca290131702086366d500cdc83b34d92..bd44076c72748049c05f2eaef7601e89c3570814 100644
--- a/Source/core/html/canvas/WebGLFramebuffer.cpp
+++ b/Source/core/html/canvas/WebGLFramebuffer.cpp
@@ -424,7 +424,7 @@ GC3Denum WebGLFramebuffer::getColorBufferFormat() const
return attachment->getFormat();
}
-GC3Denum WebGLFramebuffer::checkStatus(const char** reason) const
+GC3Denum WebGLFramebuffer::checkStatus(WebGLRenderingContext* context, WebGLSharedObject::AcquireMode neededAccessMode, const char** reason) const
{
unsigned int count = 0;
GC3Dsizei width = 0, height = 0;
@@ -439,6 +439,9 @@ GC3Denum WebGLFramebuffer::checkStatus(const char** reason) const
*reason = "attachment is not valid";
return GraphicsContext3D::FRAMEBUFFER_UNSUPPORTED;
}
+ WebGLSharedObject* object = attachment->getObject();
+ if (object && !object->isAcquiredForContext(context, neededAccessMode, true, 0, reason))
+ return GraphicsContext3D::FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
if (!attachment->getFormat()) {
*reason = "attachment is an unsupported format";
return GraphicsContext3D::FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
@@ -481,9 +484,9 @@ GC3Denum WebGLFramebuffer::checkStatus(const char** reason) const
return GraphicsContext3D::FRAMEBUFFER_COMPLETE;
}
-bool WebGLFramebuffer::onAccess(GraphicsContext3D* context3d, const char** reason)
+bool WebGLFramebuffer::onAccess(WebGLRenderingContext* context, WebGLSharedObject::AcquireMode neededAccessMode, const char** reason)
{
- if (checkStatus(reason) != GraphicsContext3D::FRAMEBUFFER_COMPLETE)
+ if (checkStatus(context, neededAccessMode, reason) != GraphicsContext3D::FRAMEBUFFER_COMPLETE)
return false;
return true;
}
« no previous file with comments | « Source/core/html/canvas/WebGLFramebuffer.h ('k') | Source/core/html/canvas/WebGLObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698