Commit 0d76dcaf authored by Ahmed Fakhry's avatar Ahmed Fakhry Committed by Commit Bot

Make shelf bounds stable during tablet mode transition.

The shelf config needs to be updated at the "starting" phase
of the tablet mode transition, so that they remain stable
during the animation. Otherwise, if the shelf bounds change
during the animation, the display work-area bounds will change
leading to many re-layouts, which will hurt the animation
smoothness.

BUG=1044316
TEST=Run the tast test: ui.TabletTransitionPerf and make sure
the animation smoothness is back to its normal value.

Change-Id: Ia376cba2d9ca624ee762da18e1bbe11a70257dfc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2020616Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Commit-Queue: Ahmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735169}
parent f256fe0b
...@@ -43,7 +43,7 @@ class ASH_EXPORT ShelfConfig : public TabletModeObserver, ...@@ -43,7 +43,7 @@ class ASH_EXPORT ShelfConfig : public TabletModeObserver,
void Shutdown(); void Shutdown();
// TabletModeObserver: // TabletModeObserver:
void OnTabletModeStarted() override; void OnTabletModeStarting() override;
void OnTabletModeEnded() override; void OnTabletModeEnded() override;
// DisplayObserver: // DisplayObserver:
......
...@@ -101,7 +101,12 @@ void ShelfConfig::Shutdown() { ...@@ -101,7 +101,12 @@ void ShelfConfig::Shutdown() {
shell->tablet_mode_controller()->RemoveObserver(this); shell->tablet_mode_controller()->RemoveObserver(this);
} }
void ShelfConfig::OnTabletModeStarted() { void ShelfConfig::OnTabletModeStarting() {
// Update the shelf config at the "starting" stage of the tablet mode
// transition, so that the shelf bounds are set and remains stable during the
// transition animation. Otherwise, updating the shelf bounds during the
// animation will lead to work-area bounds changes which lead to many
// re-layouts, hurting the animation's smoothness. https://crbug.com/1044316.
UpdateConfig(is_app_list_visible_); UpdateConfig(is_app_list_visible_);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment