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

Unified Diff: ash/common/wm/overview/window_grid.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/window_grid.cc
diff --git a/ash/common/wm/overview/window_grid.cc b/ash/common/wm/overview/window_grid.cc
index 60b9412915a08aae7ddcd0e5c77990309b5fc052..04a9e0e8cf17049c1f9a59989b67c8c896a2c883 100644
--- a/ash/common/wm/overview/window_grid.cc
+++ b/ash/common/wm/overview/window_grid.cc
@@ -97,6 +97,10 @@ const float kCardAspectRatio = 4.0f / 3.0f;
// landscape orientation).
const int kMinCardsMajor = 3;
+// Hiding windows headers can be resource intensive. Only hide the headers when
tdanderson 2016/07/18 16:26:58 nit: windows->window
varkha 2016/07/19 00:29:07 Done.
+// the number of windows in this grid is less or equal than this number.
+const int kMaxWindowsCountToHideHeader = 10;
+
const int kOverviewSelectorTransitionMilliseconds = 250;
// The color and opacity of the screen shield in overview.
@@ -446,6 +450,9 @@ void WindowGrid::PrepareForOverview() {
void WindowGrid::PositionWindowsMD(bool animate) {
if (window_list_.empty())
return;
+ const bool hide_header = window_list_.size() <= kMaxWindowsCountToHideHeader;
+ for (auto* window : window_list_)
+ window->set_hide_header(hide_header);
gfx::Rect total_bounds =
root_window_->ConvertRectToScreen(wm::GetDisplayWorkAreaBoundsInParent(
root_window_->GetChildByShellWindowId(

Powered by Google App Engine
This is Rietveld 408576698