Skip to content

Commit

Permalink
Use ScopedSetRasterScale to set overview mode window scale.
Browse files Browse the repository at this point in the history
If this CL needs to be reverted for causing a graphical glitch or
performance issue in lacros, it can be effectively reverted easily (in
the case of a non-clean revert, or unsure of revert safety) by removing
the zaura_toplevel_send_configure_raster_scale call from
AuraToplevel::OnConfigure.

CL 8/? for go/lacros-tsr

See also go/lacros-tsr-scale-control for the reasoning behind this CL

Bug: 1278651
Test: CQ
Change-Id: I9ece8527b2097fe9e2076b21924ae718b369acbf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4229937
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Reviewed-by: Sammie Quon <sammiequon@chromium.org>
Commit-Queue: Eliot Courtney <edcourtney@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1188170}
  • Loading branch information
Eliot Courtney authored and Chromium LUCI CQ committed Aug 25, 2023
1 parent acecefc commit 40ca9f8
Show file tree
Hide file tree
Showing 13 changed files with 2,281 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ash/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2545,6 +2545,8 @@ component("ash") {
"wm/pip/pip_window_resizer.h",
"wm/raster_scale/raster_scale_controller.cc",
"wm/raster_scale/raster_scale_controller.h",
"wm/raster_scale/raster_scale_layer_observer.cc",
"wm/raster_scale/raster_scale_layer_observer.h",
"wm/resize_shadow.cc",
"wm/resize_shadow.h",
"wm/resize_shadow_controller.cc",
Expand Down
5 changes: 5 additions & 0 deletions ash/wm/desks/desks_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1762,6 +1762,11 @@ void DesksController::RemoveDeskInternal(const Desk* desk,
DesksCreationRemovalSource source,
DeskCloseType close_type,
bool desk_switched) {
// Removing a desk can cause transient raster scale updates during overview
// mode, if desks are combined. Pause raster scale updates until windows are
// in their final state.
ScopedPauseRasterScaleUpdates scoped_pause;

MaybeCommitPendingDeskRemoval();

DCHECK(CanRemoveDesks());
Expand Down
6 changes: 6 additions & 0 deletions ash/wm/overview/overview_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "ash/wm/overview/overview_item.h"
#include "ash/wm/overview/overview_utils.h"
#include "ash/wm/overview/overview_wallpaper_controller.h"
#include "ash/wm/raster_scale/raster_scale_controller.h"
#include "ash/wm/screen_pinning_controller.h"
#include "ash/wm/snap_group/snap_group_controller.h"
#include "ash/wm/splitview/split_view_controller.h"
Expand Down Expand Up @@ -296,6 +297,11 @@ OverviewController::GetWindowsListInOverviewGridsForTest() {
}

void OverviewController::ToggleOverview(OverviewEnterExitType type) {
// Pause raster scale updates while the overview is being toggled. This is to
// handle the case where a mirror view is deleted then recreated when
// cancelling an overview exit animation, for example.
ScopedPauseRasterScaleUpdates scoped_pause;

// Hide the virtual keyboard as it obstructs the overview mode.
// Don't need to hide if it's the a11y keyboard, as overview mode
// can accept text input and it resizes correctly with the a11y keyboard.
Expand Down
7 changes: 7 additions & 0 deletions ash/wm/overview/overview_item.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "ash/wm/overview/overview_window_drag_controller.h"
#include "ash/wm/overview/scoped_overview_animation_settings.h"
#include "ash/wm/overview/scoped_overview_hide_windows.h"
#include "ash/wm/raster_scale/raster_scale_controller.h"
#include "ash/wm/splitview/split_view_constants.h"
#include "ash/wm/splitview/split_view_utils.h"
#include "ash/wm/tablet_mode/tablet_mode_controller.h"
Expand Down Expand Up @@ -340,6 +341,12 @@ gfx::RectF OverviewItem::GetWindowTargetBoundsWithInsets() const {

void OverviewItem::SetBounds(const gfx::RectF& target_bounds,
OverviewAnimationType animation_type) {
// Pause raster scale updates during SetBounds. For example, if we perform an
// item spawned animation, we set the initial transform but immediately start
// an animation, so we don't want to trigger a raster scale update for the
// initial transform.
ScopedPauseRasterScaleUpdates scoped_pause;

if (in_bounds_update_ ||
!Shell::Get()->overview_controller()->InOverviewSession()) {
return;
Expand Down

0 comments on commit 40ca9f8

Please sign in to comment.