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

Unified Diff: ash/rotator/screen_rotation_animator.h

Issue 2837773003: Flip the flag to enable smooth screen rotation by default. (Closed)
Patch Set: 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/rotator/screen_rotation_animator.h
diff --git a/ash/rotator/screen_rotation_animator.h b/ash/rotator/screen_rotation_animator.h
index 1a479280034c08281d14862a1f83a94a744594c0..71295561252e8fc8fe30e53c6952231ab165c0bf 100644
--- a/ash/rotator/screen_rotation_animator.h
+++ b/ash/rotator/screen_rotation_animator.h
@@ -66,6 +66,8 @@ class ASH_EXPORT ScreenRotationAnimator {
// notifies |screen_rotation_animator_observer_|.
void ProcessAnimationQueue();
+ bool CanAnimate() const { return enable_animation_; }
+
protected:
using CopyCallback =
base::Callback<void(std::unique_ptr<cc::CopyOutputResult> result)>;
@@ -148,6 +150,10 @@ class ASH_EXPORT ScreenRotationAnimator {
disable_animation_timers_for_test_ = disable_timers;
}
+ void set_enable_animation_for_test(bool enable_animation) {
+ enable_animation_ = enable_animation;
+ }
+
void StopAnimating();
// The id of the display to rotate.
@@ -170,13 +176,15 @@ class ASH_EXPORT ScreenRotationAnimator {
std::unique_ptr<ui::AnimationMetricsReporter> metrics_reporter_;
// Only set in unittest to disable animation timers.
bool disable_animation_timers_for_test_;
+ // Enables or disables animation.
+ bool enable_animation_;
base::ObserverList<ScreenRotationAnimatorObserver>
screen_rotation_animator_observers_;
std::unique_ptr<ui::LayerTreeOwner> old_layer_tree_owner_;
std::unique_ptr<ui::LayerTreeOwner> new_layer_tree_owner_;
std::unique_ptr<ui::LayerOwner> black_mask_layer_owner_;
std::unique_ptr<ScreenRotationRequest> last_pending_request_;
- bool has_switch_ash_enable_smooth_screen_rotation_;
+ bool has_switch_ash_disable_smooth_screen_rotation_;
aura::Window* root_window_;
ui::Layer* screen_rotation_container_layer_;
base::WeakPtrFactory<ScreenRotationAnimator> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698