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

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

Issue 2146323004: [ash-md] Improves smoothness with many windows in overview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [ash-md] Improves smoothness with many windows in overview (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
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 a2abe5d0e1a77c9b1e202b0c0937221f80d6ad02..745d464a95cc80404fb1cb0efb0b65e17466f564 100644
--- a/ash/common/wm/overview/scoped_transform_overview_window.cc
+++ b/ash/common/wm/overview/scoped_transform_overview_window.cc
@@ -268,7 +268,7 @@ void ScopedTransformOverviewWindow::RestoreWindow() {
ScopedAnimationSettings animation_settings_list;
BeginScopedAnimation(OverviewAnimationType::OVERVIEW_ANIMATION_RESTORE_WINDOW,
&animation_settings_list);
- SetTransform(window()->GetRootWindow(), original_transform_, 0);
+ SetTransform(window()->GetRootWindow(), original_transform_, false, 0);
std::unique_ptr<ScopedOverviewAnimationSettings> animation_settings =
CreateScopedOverviewAnimationSettings(
@@ -417,21 +417,23 @@ gfx::Transform ScopedTransformOverviewWindow::GetTransformForRect(
void ScopedTransformOverviewWindow::SetTransform(
WmWindow* root_window,
const gfx::Transform& transform,
+ bool use_masks,
float radius) {
DCHECK(overview_started_);
if (ash::MaterialDesignController::IsOverviewMaterial() &&
&transform != &original_transform_) {
- if (!mask_) {
+ if (use_masks && !mask_) {
mask_.reset(new OverviewContentMask(radius));
mask_->layer()->SetFillsBoundsOpaquely(false);
window()->GetLayer()->SetMaskLayer(mask_->layer());
}
gfx::Rect bounds(GetTargetBoundsInScreen().size());
- mask_->layer()->SetBounds(bounds);
- mask_->set_radius(radius);
- window()->GetLayer()->SchedulePaint(bounds);
-
+ if (mask_) {
+ mask_->layer()->SetBounds(bounds);
+ mask_->set_radius(radius);
+ window()->GetLayer()->SchedulePaint(bounds);
+ }
if (!determined_original_window_shape_) {
determined_original_window_shape_ = true;
SkRegion* window_shape = window()->GetLayer()->alpha_shape();
@@ -439,7 +441,8 @@ void ScopedTransformOverviewWindow::SetTransform(
original_window_shape_.reset(new SkRegion(*window_shape));
}
const int inset =
- window()->GetIntProperty(WmWindowProperty::TOP_VIEW_INSET);
+ use_masks ? window()->GetIntProperty(WmWindowProperty::TOP_VIEW_INSET)
+ : 0;
if (inset > 0) {
bounds.Inset(0, inset, 0, 0);
SkRegion* region = new SkRegion;

Powered by Google App Engine
This is Rietveld 408576698