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

Unified Diff: content/common/gpu/image_transport_surface_overlay_mac.mm

Issue 1393393002: Mac Overlays: Clear root layer's contents when it is not specified (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master2
Patch Set: Created 5 years, 2 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: content/common/gpu/image_transport_surface_overlay_mac.mm
diff --git a/content/common/gpu/image_transport_surface_overlay_mac.mm b/content/common/gpu/image_transport_surface_overlay_mac.mm
index 1a18d0b717594da0fb51796777f085c514a35e62..d0e140675902c7d73b2a7d9cf37358f92ff6a5fd 100644
--- a/content/common/gpu/image_transport_surface_overlay_mac.mm
+++ b/content/common/gpu/image_transport_surface_overlay_mac.mm
@@ -362,8 +362,7 @@ void ImageTransportSurfaceOverlayMac::DisplayFirstPendingSwapImmediately() {
dip_damage_rect.Subtract(plane->dip_frame_rect);
ScopedCAActionDisabler disabler;
- if (swap->root_plane.get())
- UpdateRootAndPartialDamagePlanes(swap->root_plane, dip_damage_rect);
+ UpdateRootAndPartialDamagePlanes(swap->root_plane, dip_damage_rect);
UpdateOverlayPlanes(swap->overlay_planes);
UpdateCALayerTree();
swap->overlay_planes.clear();
@@ -410,6 +409,16 @@ void ImageTransportSurfaceOverlayMac::UpdateRootAndPartialDamagePlanes(
old_partial_damage_planes.swap(current_partial_damage_planes_);
linked_ptr<OverlayPlane> plane_for_swap;
+ // If there is no new root plane, destroy the old one.
+ if (!new_root_plane.get()) {
+ for (auto& old_plane : old_partial_damage_planes)
+ old_plane->Destroy();
+ if (current_root_plane_.get())
+ current_root_plane_->Destroy();
+ current_root_plane_.reset();
+ return;
+ }
+
// If the frame's size changed, if we haven't updated the root layer, or if
// we have full damage, then use the root layer directly.
if (!current_root_plane_.get() ||
« 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