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

Unified Diff: ash/root_window_controller.cc

Issue 2790583004: Add second copy request after screen rotation to flatten the layers in animation. (Closed)
Patch Set: Move some functions to ash/utility/transformer_util. Created 3 years, 8 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/root_window_controller.cc
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index d3f4f4937c2bdcb71084380f362b3359e2613849..59ba8761168fdc196f7f713b15f623f7e585e9dc 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -867,37 +867,47 @@ void RootWindowController::InitLayoutManagers() {
void RootWindowController::CreateContainers() {
WmWindow* root = GetWindow();
+ // For screen rotation animation: add a NOT_DRAWN layer in between the
+ // root_window's layer and its current children so that we only need to
+ // initiate two LayerAnimationSequences. One for the new layers and one for
+ // the old layers.
+ WmWindow* screen_rotation_container = CreateContainer(
+ kShellWindowId_ScreenRotationContainer, "ScreenRotationContainer", root);
+ screen_rotation_container->SetChildWindowVisibilityChangesAnimated();
+
// These containers are just used by PowerButtonController to animate groups
// of containers simultaneously without messing up the current transformations
- // on those containers. These are direct children of the root window; all of
- // the other containers are their children.
+ // on those containers. These are direct children of the
+ // screen_rotation_container window; all of the other containers are their
+ // children.
// The wallpaper container is not part of the lock animation, so it is not
// included in those animate groups. When the screen is locked, the wallpaper
// is moved to the lock screen wallpaper container (and moved back on unlock).
// Ensure that there's an opaque layer occluding the non-lock-screen layers.
- WmWindow* wallpaper_container = CreateContainer(
- kShellWindowId_WallpaperContainer, "WallpaperContainer", root);
+ WmWindow* wallpaper_container =
+ CreateContainer(kShellWindowId_WallpaperContainer, "WallpaperContainer",
+ screen_rotation_container);
wallpaper_container->SetChildWindowVisibilityChangesAnimated();
- WmWindow* non_lock_screen_containers =
- CreateContainer(kShellWindowId_NonLockScreenContainersContainer,
- "NonLockScreenContainersContainer", root);
+ WmWindow* non_lock_screen_containers = CreateContainer(
+ kShellWindowId_NonLockScreenContainersContainer,
+ "NonLockScreenContainersContainer", screen_rotation_container);
// Clip all windows inside this container, as half pixel of the window's
// texture may become visible when the screen is scaled. crbug.com/368591.
non_lock_screen_containers->SetMasksToBounds(true);
- WmWindow* lock_wallpaper_containers =
- CreateContainer(kShellWindowId_LockScreenWallpaperContainer,
- "LockScreenWallpaperContainer", root);
+ WmWindow* lock_wallpaper_containers = CreateContainer(
+ kShellWindowId_LockScreenWallpaperContainer,
+ "LockScreenWallpaperContainer", screen_rotation_container);
lock_wallpaper_containers->SetChildWindowVisibilityChangesAnimated();
- WmWindow* lock_screen_containers =
- CreateContainer(kShellWindowId_LockScreenContainersContainer,
- "LockScreenContainersContainer", root);
- WmWindow* lock_screen_related_containers =
- CreateContainer(kShellWindowId_LockScreenRelatedContainersContainer,
- "LockScreenRelatedContainersContainer", root);
+ WmWindow* lock_screen_containers = CreateContainer(
+ kShellWindowId_LockScreenContainersContainer,
+ "LockScreenContainersContainer", screen_rotation_container);
+ WmWindow* lock_screen_related_containers = CreateContainer(
+ kShellWindowId_LockScreenRelatedContainersContainer,
+ "LockScreenRelatedContainersContainer", screen_rotation_container);
CreateContainer(kShellWindowId_UnparentedControlContainer,
"UnparentedControlContainer", non_lock_screen_containers);
@@ -1024,13 +1034,14 @@ void RootWindowController::CreateContainers() {
overlay_container->SetBoundsInScreenBehaviorForChildren(
WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
- WmWindow* mouse_cursor_container = CreateContainer(
- kShellWindowId_MouseCursorContainer, "MouseCursorContainer", root);
+ WmWindow* mouse_cursor_container =
+ CreateContainer(kShellWindowId_MouseCursorContainer,
+ "MouseCursorContainer", screen_rotation_container);
mouse_cursor_container->SetBoundsInScreenBehaviorForChildren(
WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
CreateContainer(kShellWindowId_PowerButtonAnimationContainer,
- "PowerButtonAnimationContainer", root);
+ "PowerButtonAnimationContainer", screen_rotation_container);
}
void RootWindowController::CreateSystemWallpaper(

Powered by Google App Engine
This is Rietveld 408576698