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

Unified Diff: ash/common/wm/overview/scoped_transform_overview_window.cc

Issue 2126873005: [ash-md] Doesn't recreate a rounded rect mask for overview windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [ash-md] Doesn't recreate a rounded rect mask for overview windows (rebased) Created 4 years, 5 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 | ui/compositor/layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/overview/scoped_transform_overview_window.cc
diff --git a/ash/common/wm/overview/scoped_transform_overview_window.cc b/ash/common/wm/overview/scoped_transform_overview_window.cc
index 0816a10c1bbb156e9e2b279b9babcb39a47f36a4..0a13bf6ee889fa514797bd31c41282b49b4089e9 100644
--- a/ash/common/wm/overview/scoped_transform_overview_window.cc
+++ b/ash/common/wm/overview/scoped_transform_overview_window.cc
@@ -183,6 +183,7 @@ class ScopedTransformOverviewWindow::OverviewContentMask
explicit OverviewContentMask(float radius);
~OverviewContentMask() override;
+ void set_radius(float radius) { radius_ = radius; }
ui::Layer* layer() { return &layer_; }
// Overridden from LayerDelegate.
@@ -405,11 +406,15 @@ void ScopedTransformOverviewWindow::SetTransform(
if (ash::MaterialDesignController::IsOverviewMaterial() &&
&transform != &original_transform_) {
+ if (!mask_) {
+ mask_.reset(new OverviewContentMask(radius));
+ mask_->layer()->SetFillsBoundsOpaquely(false);
+ window()->GetLayer()->SetMaskLayer(mask_->layer());
+ }
gfx::Rect bounds(GetTargetBoundsInScreen().size());
- mask_.reset(new OverviewContentMask(radius));
- mask_->layer()->SetFillsBoundsOpaquely(false);
mask_->layer()->SetBounds(bounds);
- window()->GetLayer()->SetMaskLayer(mask_->layer());
+ mask_->set_radius(radius);
+ window()->GetLayer()->SchedulePaint(bounds);
SkRegion* window_shape = window()->GetLayer()->alpha_shape();
if (!original_window_shape_ && window_shape)
« no previous file with comments | « no previous file | ui/compositor/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698