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

Unified Diff: Source/core/html/canvas/WebGLContextGroup.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/WebGLContextGroup.h ('k') | Source/core/html/canvas/WebGLContextObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/WebGLContextGroup.cpp
diff --git a/Source/core/html/canvas/WebGLContextGroup.cpp b/Source/core/html/canvas/WebGLContextGroup.cpp
index 46650a6e29205de66c7c84e4b19e1d67f846b9a2..8a6c463fe07bfdf3e84b545f932515767148d247 100644
--- a/Source/core/html/canvas/WebGLContextGroup.cpp
+++ b/Source/core/html/canvas/WebGLContextGroup.cpp
@@ -61,6 +61,12 @@ void WebGLContextGroup::addContext(WebGLRenderingContext* context)
void WebGLContextGroup::removeContext(WebGLRenderingContext* context)
{
+ // Release all the resources this context has acquired.
+ for (HashSet<WebGLSharedObject*>::iterator it = m_groupObjects.begin(); it != m_groupObjects.end(); ++it) {
+ (*it)->release(context);
+ (*it)->cancelAllPendingRequestsForContext(context);
+ }
+
// We must call detachAndRemoveAllObjects before removing the last context.
if (m_contexts.size() == 1 && m_contexts.contains(context))
detachAndRemoveAllObjects();
@@ -96,4 +102,13 @@ void WebGLContextGroup::loseContextGroup(WebGLRenderingContext::LostContextMode
(*it)->loseContextImpl(mode);
}
+void WebGLContextGroup::cancelAcquireSharedResource(const WebGLRenderingContext* context, long id)
+{
+ for (HashSet<WebGLSharedObject*>::iterator it = m_groupObjects.begin(); it != m_groupObjects.end(); ++it) {
+ if ((*it)->cancelAcquireRequest(context, id)) {
+ break;
+ }
+ }
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/html/canvas/WebGLContextGroup.h ('k') | Source/core/html/canvas/WebGLContextObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698