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

Unified Diff: Source/platform/graphics/Canvas2DLayerBridge.cpp

Issue 180633010: Fix crash in Canvas2DLayerBridge when handling a GPU context loss (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/Canvas2DLayerBridge.cpp
diff --git a/Source/platform/graphics/Canvas2DLayerBridge.cpp b/Source/platform/graphics/Canvas2DLayerBridge.cpp
index e54518de3c4a8183ec47ce3359cb36f703f083da..713414b46b380c8e527cfb48e7d002226eefeaf0 100644
--- a/Source/platform/graphics/Canvas2DLayerBridge.cpp
+++ b/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -323,12 +323,14 @@ bool Canvas2DLayerBridge::isValid()
ASSERT(m_layer);
if (m_destructionInProgress)
return false;
- if (m_contextProvider->context3d()->isContextLost() || !m_surfaceIsValid) {
+ if (!m_contextProvider || m_contextProvider->context3d()->isContextLost() || !m_surfaceIsValid) {
// Attempt to recover.
blink::WebGraphicsContext3D* sharedContext = 0;
- m_layer->clearTexture();
+ // We must clear the mailboxes before calling m_layer->clearTexture() to prevent
+ // re-entry via mailboxReleased from operating on defunct GrContext objects.
m_mailboxes.clear();
m_releasedMailboxInfoIndex = InvalidMailboxIndex;
+ m_layer->clearTexture();
m_contextProvider = adoptPtr(blink::Platform::current()->createSharedOffscreenGraphicsContext3DProvider());
if (m_contextProvider)
sharedContext = m_contextProvider->context3d();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698