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

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

Issue 15876011: Make WebGL extensions get lost when context is lost. (Closed) 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/WebGLLoseContext.h ('k') | Source/core/html/canvas/WebGLRenderingContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/WebGLLoseContext.cpp
diff --git a/Source/core/html/canvas/WebGLLoseContext.cpp b/Source/core/html/canvas/WebGLLoseContext.cpp
index 49b3a72fcc5e3eddda884f7068e8ef4ecd791299..5238316fe2c7155ff1324584ed1b412ab1b0c728 100644
--- a/Source/core/html/canvas/WebGLLoseContext.cpp
+++ b/Source/core/html/canvas/WebGLLoseContext.cpp
@@ -41,24 +41,32 @@ WebGLLoseContext::~WebGLLoseContext()
{
}
+void WebGLLoseContext::lose(bool force)
+{
+ if (force)
+ WebGLExtension::lose(true);
+}
+
WebGLExtension::ExtensionName WebGLLoseContext::getName() const
{
return WebGLLoseContextName;
}
-PassOwnPtr<WebGLLoseContext> WebGLLoseContext::create(WebGLRenderingContext* context)
+PassRefPtr<WebGLLoseContext> WebGLLoseContext::create(WebGLRenderingContext* context)
{
- return adoptPtr(new WebGLLoseContext(context));
+ return adoptRef(new WebGLLoseContext(context));
}
void WebGLLoseContext::loseContext()
{
- m_context->forceLostContext(WebGLRenderingContext::SyntheticLostContext);
+ if (!isLost())
+ m_context->forceLostContext(WebGLRenderingContext::SyntheticLostContext);
}
void WebGLLoseContext::restoreContext()
{
- m_context->forceRestoreContext();
+ if (!isLost())
+ m_context->forceRestoreContext();
}
bool WebGLLoseContext::supported(WebGLRenderingContext*)
« no previous file with comments | « Source/core/html/canvas/WebGLLoseContext.h ('k') | Source/core/html/canvas/WebGLRenderingContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698