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

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

Issue 2808493002: [blink] Request compositing update when canvas hibernates/wakes up. (Closed)
Patch Set: rebase Created 3 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
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 1cef1ac82054c64522dbc3563e3a1868df015d50..d29e5394858b786b029383edee7b2c5bc22a71ef 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -528,6 +528,9 @@ void Canvas2DLayerBridge::Hibernate() {
#if USE_IOSURFACE_FOR_2D_CANVAS
ClearCHROMIUMImageCache();
#endif // USE_IOSURFACE_FOR_2D_CANVAS
+ // shouldBeDirectComposited() may have changed.
+ if (image_buffer_)
+ image_buffer_->SetNeedsCompositingUpdate();
logger_->DidStartHibernating();
}
@@ -607,11 +610,15 @@ SkSurface* Canvas2DLayerBridge::GetOrCreateSurface(AccelerationHint hint) {
&copy_paint);
hibernation_image_.reset();
- if (image_buffer_)
+ if (image_buffer_) {
image_buffer_->UpdateGPUMemoryUsage();
- if (image_buffer_ && !is_deferral_enabled_)
- image_buffer_->ResetCanvas(surface_paint_canvas_.get());
+ if (!is_deferral_enabled_)
+ image_buffer_->ResetCanvas(surface_paint_canvas_.get());
+
+ // shouldBeDirectComposited() may have changed.
+ image_buffer_->SetNeedsCompositingUpdate();
+ }
}
return surface_.get();

Powered by Google App Engine
This is Rietveld 408576698