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

Side by Side Diff: ash/rotator/screen_rotation_animator.cc

Issue 2383263002: Generalize layer mirroring for phantom windows (Closed)
Patch Set: Observe layer via nested class Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/rotator/screen_rotation_animator.h" 5 #include "ash/rotator/screen_rotation_animator.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 const int old_layer_initial_rotation_degrees = 163 const int old_layer_initial_rotation_degrees =
164 (Is180DegreeFlip(initial_orientation, new_rotation) ? 180 : 90); 164 (Is180DegreeFlip(initial_orientation, new_rotation) ? 180 : 90);
165 165
166 const base::TimeDelta duration = 166 const base::TimeDelta duration =
167 base::TimeDelta::FromMilliseconds(kRotationDurationInMs); 167 base::TimeDelta::FromMilliseconds(kRotationDurationInMs);
168 168
169 const gfx::Tween::Type tween_type = gfx::Tween::FAST_OUT_LINEAR_IN; 169 const gfx::Tween::Type tween_type = gfx::Tween::FAST_OUT_LINEAR_IN;
170 170
171 std::unique_ptr<ui::LayerTreeOwner> old_layer_tree = 171 std::unique_ptr<ui::LayerTreeOwner> old_layer_tree =
172 ::wm::RecreateLayers(root_window, nullptr); 172 ::wm::RecreateLayers(root_window);
173 173
174 // Add the cloned layer tree in to the root, so it will be rendered. 174 // Add the cloned layer tree in to the root, so it will be rendered.
175 root_window->layer()->Add(old_layer_tree->root()); 175 root_window->layer()->Add(old_layer_tree->root());
176 root_window->layer()->StackAtTop(old_layer_tree->root()); 176 root_window->layer()->StackAtTop(old_layer_tree->root());
177 177
178 std::unique_ptr<LayerCleanupObserver> layer_cleanup_observer( 178 std::unique_ptr<LayerCleanupObserver> layer_cleanup_observer(
179 new LayerCleanupObserver(std::move(old_layer_tree))); 179 new LayerCleanupObserver(std::move(old_layer_tree)));
180 180
181 Shell::GetInstance()->display_manager()->SetDisplayRotation( 181 Shell::GetInstance()->display_manager()->SetDisplayRotation(
182 display_id, new_rotation, source); 182 display_id, new_rotation, source);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 const display::Display::Rotation current_rotation = 260 const display::Display::Rotation current_rotation =
261 GetCurrentRotation(display_id_); 261 GetCurrentRotation(display_id_);
262 262
263 if (current_rotation == new_rotation) 263 if (current_rotation == new_rotation)
264 return; 264 return;
265 265
266 RotateScreen(display_id_, new_rotation, source); 266 RotateScreen(display_id_, new_rotation, source);
267 } 267 }
268 268
269 } // namespace ash 269 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698