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

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

Issue 2828693002: [blink] Request compositing update when canvas hibernates/wakes up. (Closed)
Patch Set: 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 cf7ef93a9808be5ba8a74d1d40058b64c998be26..9cda39adc1623176949ab8c20f4c6818c1d0889a 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -527,6 +527,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();
}
@@ -606,11 +609,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