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

Side by Side Diff: ui/compositor/layer_animator.h

Issue 105673008: Remove unneeded ScopedLayerAnimationSettings::LockTransitionDuration() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef UI_COMPOSITOR_LAYER_ANIMATOR_H_ 5 #ifndef UI_COMPOSITOR_LAYER_ANIMATOR_H_
6 #define UI_COMPOSITOR_LAYER_ANIMATOR_H_ 6 #define UI_COMPOSITOR_LAYER_ANIMATOR_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 float GetTargetBrightness() const; 81 float GetTargetBrightness() const;
82 82
83 // Sets the grayscale on the delegate. May cause an implicit animation. 83 // Sets the grayscale on the delegate. May cause an implicit animation.
84 virtual void SetGrayscale(float grayscale); 84 virtual void SetGrayscale(float grayscale);
85 float GetTargetGrayscale() const; 85 float GetTargetGrayscale() const;
86 86
87 // Sets the color on the delegate. May cause an implicit animation. 87 // Sets the color on the delegate. May cause an implicit animation.
88 virtual void SetColor(SkColor color); 88 virtual void SetColor(SkColor color);
89 SkColor GetTargetColor() const; 89 SkColor GetTargetColor() const;
90 90
91 // Returns the default length of animations, including adjustment for slow
92 // animation mode if set.
93 base::TimeDelta GetTransitionDuration() const;
94
95 // Sets the layer animation delegate the animator is associated with. The 91 // Sets the layer animation delegate the animator is associated with. The
96 // animator does not own the delegate. The layer animator expects a non-NULL 92 // animator does not own the delegate. The layer animator expects a non-NULL
97 // delegate for most of its operations, so do not call any methods without 93 // delegate for most of its operations, so do not call any methods without
98 // a valid delegate installed. 94 // a valid delegate installed.
99 void SetDelegate(LayerAnimationDelegate* delegate); 95 void SetDelegate(LayerAnimationDelegate* delegate);
100 96
101 // Sets the animation preemption strategy. This determines the behaviour if 97 // Sets the animation preemption strategy. This determines the behaviour if
102 // a property is set during an animation. The default is 98 // a property is set during an animation. The default is
103 // IMMEDIATELY_SET_NEW_TARGET (see ImmediatelySetNewTarget below). 99 // IMMEDIATELY_SET_NEW_TARGET (see ImmediatelySetNewTarget below).
104 void set_preemption_strategy(PreemptionStrategy strategy) { 100 void set_preemption_strategy(PreemptionStrategy strategy) {
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 bool StartSequenceImmediately(LayerAnimationSequence* sequence); 287 bool StartSequenceImmediately(LayerAnimationSequence* sequence);
292 288
293 // Sets the value of target as if all the running and queued animations were 289 // Sets the value of target as if all the running and queued animations were
294 // allowed to finish. 290 // allowed to finish.
295 void GetTargetValue(LayerAnimationElement::TargetValue* target) const; 291 void GetTargetValue(LayerAnimationElement::TargetValue* target) const;
296 292
297 // Called whenever an animation is added to the animation queue. Either by 293 // Called whenever an animation is added to the animation queue. Either by
298 // starting the animation or adding to the queue. 294 // starting the animation or adding to the queue.
299 void OnScheduled(LayerAnimationSequence* sequence); 295 void OnScheduled(LayerAnimationSequence* sequence);
300 296
301 // Sets |transition_duration_| unless |is_transition_duration_locked_| is set. 297 // Returns the default length of animations, including adjustment for slow
298 // animation mode if set.
299 base::TimeDelta GetTransitionDuration() const;
oshima 2014/01/08 00:29:13 maybe we should rename this (and below) to {Get|Se
300
301 // Sets |transition_duration_|.
302 void SetTransitionDuration(base::TimeDelta duration); 302 void SetTransitionDuration(base::TimeDelta duration);
303 303
304 // Clears the animation queues and notifies any running animations that they 304 // Clears the animation queues and notifies any running animations that they
305 // have been aborted. 305 // have been aborted.
306 void ClearAnimationsInternal(); 306 void ClearAnimationsInternal();
307 307
308 // Cleans up any running animations that may have been deleted. 308 // Cleans up any running animations that may have been deleted.
309 void PurgeDeletedAnimations(); 309 void PurgeDeletedAnimations();
310 310
311 // This is the queue of animations to run. 311 // This is the queue of animations to run.
312 AnimationQueue animation_queue_; 312 AnimationQueue animation_queue_;
313 313
314 // The target of all layer animations. 314 // The target of all layer animations.
315 LayerAnimationDelegate* delegate_; 315 LayerAnimationDelegate* delegate_;
316 316
317 // The currently running animations. 317 // The currently running animations.
318 RunningAnimations running_animations_; 318 RunningAnimations running_animations_;
319 319
320 // Determines how animations are replaced. 320 // Determines how animations are replaced.
321 PreemptionStrategy preemption_strategy_; 321 PreemptionStrategy preemption_strategy_;
322 322
323 // Whether the length of animations is locked. While it is locked
324 // SetTransitionDuration does not set |transition_duration_|.
325 bool is_transition_duration_locked_;
326
327 // The default length of animations. 323 // The default length of animations.
328 base::TimeDelta transition_duration_; 324 base::TimeDelta transition_duration_;
329 325
330 // The default tween type for implicit transitions 326 // The default tween type for implicit transitions
331 gfx::Tween::Type tween_type_; 327 gfx::Tween::Type tween_type_;
332 328
333 // Used for coordinating the starting of animations. 329 // Used for coordinating the starting of animations.
334 base::TimeTicks last_step_time_; 330 base::TimeTicks last_step_time_;
335 331
336 // True if we are being stepped by our container. 332 // True if we are being stepped by our container.
(...skipping 10 matching lines...) Expand all
347 // Observers are notified when layer animations end, are scheduled or are 343 // Observers are notified when layer animations end, are scheduled or are
348 // aborted. 344 // aborted.
349 ObserverList<LayerAnimationObserver> observers_; 345 ObserverList<LayerAnimationObserver> observers_;
350 346
351 DISALLOW_COPY_AND_ASSIGN(LayerAnimator); 347 DISALLOW_COPY_AND_ASSIGN(LayerAnimator);
352 }; 348 };
353 349
354 } // namespace ui 350 } // namespace ui
355 351
356 #endif // UI_COMPOSITOR_LAYER_ANIMATOR_H_ 352 #endif // UI_COMPOSITOR_LAYER_ANIMATOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/login_display_host_impl.cc ('k') | ui/compositor/layer_animator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698