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

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

Issue 1652293002: Fix 2D canvas content loss while page is hidden (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 4 years, 11 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 | third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
index f1a359903b1a699c0e1f2a7eec4ac6221188018c..55967fe42a2d60b290640c12cc70e024e742d8ed 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -520,6 +520,8 @@ bool Canvas2DLayerBridge::checkSurfaceValid()
ASSERT(!m_destructionInProgress);
if (m_destructionInProgress)
return false;
+ if (isHibernating())
+ return true;
if (!m_layer)
return true;
if (!m_surface)
@@ -582,11 +584,11 @@ bool Canvas2DLayerBridge::prepareMailbox(WebExternalTextureMailbox* outMailbox,
// 4. Here.
return false;
}
- ASSERT(isAccelerated() || isHibernating());
+ ASSERT(isAccelerated() || isHibernating() || m_softwareRenderingWhileHidden);
// if hibernating but not hidden, we want to wake up from
// hibernation
- if (isHibernating() && isHidden())
+ if ((isHibernating() || m_softwareRenderingWhileHidden) && isHidden())
return false;
if (bitmap) {
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698