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

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

Issue 254453002: Fix WebGL context restoration logic. The retry mechanism was broken when the ownership of the WebGr… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added more safety checks upon context restoration. Created 6 years, 8 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/WebGLRenderingContext.cpp ('k') | Source/platform/graphics/gpu/DrawingBuffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/WebGLRenderingContextBase.cpp
diff --git a/Source/core/html/canvas/WebGLRenderingContextBase.cpp b/Source/core/html/canvas/WebGLRenderingContextBase.cpp
index 2abffdb3c203a6e83ef618e5bc0731d53d7602f7..1d422fdd3f855be851fdb514d821b306bf43b272 100644
--- a/Source/core/html/canvas/WebGLRenderingContextBase.cpp
+++ b/Source/core/html/canvas/WebGLRenderingContextBase.cpp
@@ -4230,7 +4230,7 @@ Extensions3DUtil* WebGLRenderingContextBase::extensionsUtil()
{
ASSERT(!isContextLost());
if (!m_extensionsUtil)
- m_extensionsUtil = adoptPtr(new Extensions3DUtil(webContext()));
+ m_extensionsUtil = Extensions3DUtil::create(webContext());
return m_extensionsUtil.get();
}
@@ -5444,6 +5444,7 @@ void WebGLRenderingContextBase::maybeRestoreContext(Timer<WebGLRenderingContextB
blink::WebGraphicsContext3D::Attributes attributes = m_requestedAttributes->attributes(canvas()->document().topDocument().url().string(), settings);
OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::current()->createOffscreenGraphicsContext3D(attributes, 0));
RefPtr<DrawingBuffer> drawingBuffer;
+ // Even if a non-null WebGraphicsContext3D is created, until it's made current, it isn't known whether the context is still lost.
if (context) {
RefPtr<WebGLRenderingContextEvictionManager> contextEvictionManager = adoptRef(new WebGLRenderingContextEvictionManager());
« no previous file with comments | « Source/core/html/canvas/WebGLRenderingContext.cpp ('k') | Source/platform/graphics/gpu/DrawingBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698