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

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

Issue 2872123002: Wallpaper resize extents compositor lock timeout. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | ash/wallpaper/wallpaper_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/display/window_tree_host_manager.h" 8 #include "ash/display/window_tree_host_manager.h"
9 #include "ash/public/cpp/shell_window_ids.h" 9 #include "ash/public/cpp/shell_window_ids.h"
10 #include "ash/rotator/screen_rotation_animation.h" 10 #include "ash/rotator/screen_rotation_animation.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 CreateOldLayerTreeForSlowAnimation(); 218 CreateOldLayerTreeForSlowAnimation();
219 SetRotation(rotation_request->old_rotation, rotation_request->new_rotation, 219 SetRotation(rotation_request->old_rotation, rotation_request->new_rotation,
220 rotation_request->source); 220 rotation_request->source);
221 AnimateRotation(std::move(rotation_request)); 221 AnimateRotation(std::move(rotation_request));
222 } 222 }
223 223
224 void ScreenRotationAnimator::SetRotation( 224 void ScreenRotationAnimator::SetRotation(
225 display::Display::Rotation old_rotation, 225 display::Display::Rotation old_rotation,
226 display::Display::Rotation new_rotation, 226 display::Display::Rotation new_rotation,
227 display::Display::RotationSource source) { 227 display::Display::RotationSource source) {
228 // Allow compositor locks to extend timeout, so that screen rotation only
229 // takes output copy after contents are properlly resized, such as wallpaper
230 // and ARC apps.
231 ui::Compositor* compositor = root_window_->layer()->GetCompositor();
232 compositor->set_allow_locks_to_extend_timeout(true);
228 Shell::Get()->display_manager()->SetDisplayRotation(display_id_, new_rotation, 233 Shell::Get()->display_manager()->SetDisplayRotation(display_id_, new_rotation,
229 source); 234 source);
230 const display::Display display = 235 const display::Display display =
231 Shell::Get()->display_manager()->GetDisplayForId(display_id_); 236 Shell::Get()->display_manager()->GetDisplayForId(display_id_);
232 old_layer_tree_owner_->root()->SetTransform( 237 old_layer_tree_owner_->root()->SetTransform(
233 CreateScreenRotationOldLayerTransformForDisplay(old_rotation, 238 CreateScreenRotationOldLayerTransformForDisplay(old_rotation,
234 new_rotation, display)); 239 new_rotation, display));
240 compositor->set_allow_locks_to_extend_timeout(false);
oshima 2017/05/10 05:27:50 move this to 235, after SetDisplayRotation
wutao 2017/05/10 21:07:55 Done.
235 } 241 }
236 242
237 void ScreenRotationAnimator::RequestCopyScreenRotationContainerLayer( 243 void ScreenRotationAnimator::RequestCopyScreenRotationContainerLayer(
238 std::unique_ptr<cc::CopyOutputRequest> copy_output_request) { 244 std::unique_ptr<cc::CopyOutputRequest> copy_output_request) {
239 copy_output_request->set_area( 245 copy_output_request->set_area(
240 gfx::Rect(screen_rotation_container_layer_->size())); 246 gfx::Rect(screen_rotation_container_layer_->size()));
241 screen_rotation_container_layer_->RequestCopyOfOutput( 247 screen_rotation_container_layer_->RequestCopyOfOutput(
242 std::move(copy_output_request)); 248 std::move(copy_output_request));
243 } 249 }
244 250
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 // the rotation request comes before the copy request finished. 490 // the rotation request comes before the copy request finished.
485 if (old_layer_tree_owner_) 491 if (old_layer_tree_owner_)
486 old_layer_tree_owner_->root()->GetAnimator()->StopAnimating(); 492 old_layer_tree_owner_->root()->GetAnimator()->StopAnimating();
487 if (new_layer_tree_owner_) 493 if (new_layer_tree_owner_)
488 new_layer_tree_owner_->root()->GetAnimator()->StopAnimating(); 494 new_layer_tree_owner_->root()->GetAnimator()->StopAnimating();
489 if (IsDisplayIdValid(display_id_) && black_mask_layer_owner_) 495 if (IsDisplayIdValid(display_id_) && black_mask_layer_owner_)
490 root_window_->layer()->Remove(black_mask_layer_owner_->layer()); 496 root_window_->layer()->Remove(black_mask_layer_owner_->layer());
491 } 497 }
492 498
493 } // namespace ash 499 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/wallpaper/wallpaper_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698