Index: ash/root_window_controller.cc |
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc |
index 6ba028a3fd122aa41e534c4abf0d679e01904e21..e0bdf29a00849a274d7060e9d07cbd7e1d9aebfb 100644 |
--- a/ash/root_window_controller.cc |
+++ b/ash/root_window_controller.cc |
@@ -868,37 +868,46 @@ 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* delegate_root = CreateContainer( |
+ kShellWindowId_DelegateRootContainer, "DelegateRootContainer", root); |
oshima
2017/04/05 20:26:51
"delegate" is overused. maybe surrogate root?
+j
James Cook
2017/04/05 20:54:41
Why not just ScreenRotationContainer, since that's
wutao
2017/04/05 23:37:34
Done.
|
+ delegate_root->SetChildWindowVisibilityChangesAnimated(); |
+ delegate_root->GetLayer()->set_name("DelegateRootLayer"); |
+ |
// 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 delegate_root 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); |
+ kShellWindowId_WallpaperContainer, "WallpaperContainer", delegate_root); |
wallpaper_container->SetChildWindowVisibilityChangesAnimated(); |
WmWindow* non_lock_screen_containers = |
CreateContainer(kShellWindowId_NonLockScreenContainersContainer, |
- "NonLockScreenContainersContainer", root); |
+ "NonLockScreenContainersContainer", delegate_root); |
// 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); |
+ "LockScreenWallpaperContainer", delegate_root); |
lock_wallpaper_containers->SetChildWindowVisibilityChangesAnimated(); |
WmWindow* lock_screen_containers = |
CreateContainer(kShellWindowId_LockScreenContainersContainer, |
- "LockScreenContainersContainer", root); |
+ "LockScreenContainersContainer", delegate_root); |
WmWindow* lock_screen_related_containers = |
CreateContainer(kShellWindowId_LockScreenRelatedContainersContainer, |
- "LockScreenRelatedContainersContainer", root); |
+ "LockScreenRelatedContainersContainer", delegate_root); |
CreateContainer(kShellWindowId_UnparentedControlContainer, |
"UnparentedControlContainer", non_lock_screen_containers); |
@@ -1025,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", delegate_root); |
mouse_cursor_container->SetBoundsInScreenBehaviorForChildren( |
WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); |
CreateContainer(kShellWindowId_PowerButtonAnimationContainer, |
- "PowerButtonAnimationContainer", root); |
+ "PowerButtonAnimationContainer", delegate_root); |
} |
void RootWindowController::CreateSystemWallpaper( |