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

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

Issue 11316135: NOT READY FOR REVIEW - Add support for custom animation timers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « ui/compositor/layer_animation_timer.h ('k') | ui/compositor/layer_animator.cc » ('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 (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 11 matching lines...) Expand all
22 class Rect; 22 class Rect;
23 class Transform; 23 class Transform;
24 } 24 }
25 25
26 namespace ui { 26 namespace ui {
27 class Animation; 27 class Animation;
28 class Layer; 28 class Layer;
29 class LayerAnimationSequence; 29 class LayerAnimationSequence;
30 class LayerAnimationDelegate; 30 class LayerAnimationDelegate;
31 class LayerAnimationObserver; 31 class LayerAnimationObserver;
32 class LayerAnimationTimer;
32 class ScopedLayerAnimationSettings; 33 class ScopedLayerAnimationSettings;
33 34
34 // When a property of layer needs to be changed it is set by way of 35 // When a property of layer needs to be changed it is set by way of
35 // LayerAnimator. This enables LayerAnimator to animate property changes. 36 // LayerAnimator. This enables LayerAnimator to animate property changes.
36 // NB: during many tests, set_disable_animations_for_test is used and causes 37 // NB: during many tests, set_disable_animations_for_test is used and causes
37 // all animations to complete immediately. The layer animation is ref counted 38 // all animations to complete immediately. The layer animation is ref counted
38 // so that if its owning layer is deleted (and the owning layer is only other 39 // so that if its owning layer is deleted (and the owning layer is only other
39 // class that should ever hold a ref ptr to a LayerAnimator), the animator can 40 // class that should ever hold a ref ptr to a LayerAnimator), the animator can
40 // ensure that it is not disposed of until it finishes executing. It does this 41 // ensure that it is not disposed of until it finishes executing. It does this
41 // by holding a reference to itself for the duration of methods for which it 42 // by holding a reference to itself for the duration of methods for which it
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 187
187 // When set to true, all animations complete immediately. 188 // When set to true, all animations complete immediately.
188 static void set_disable_animations_for_test(bool disable_animations) { 189 static void set_disable_animations_for_test(bool disable_animations) {
189 disable_animations_for_test_ = disable_animations; 190 disable_animations_for_test_ = disable_animations;
190 } 191 }
191 192
192 static bool disable_animations_for_test() { 193 static bool disable_animations_for_test() {
193 return disable_animations_for_test_; 194 return disable_animations_for_test_;
194 } 195 }
195 196
197 // Takes ownership of the given timer.
198 // FIXME(vollick): Once we've written a TestLayerAnimationTimer than can be
199 // used to advance animations, we can probably get rid of last_tick_time() and
200 // all the code in the layer animation tests that advances animations using
201 // AnimationContainerElement::Step.
202 static void SetAnimationTimer(LayerAnimationTimer* timer);
203
196 protected: 204 protected:
197 virtual ~LayerAnimator(); 205 virtual ~LayerAnimator();
198 206
199 LayerAnimationDelegate* delegate() { return delegate_; } 207 LayerAnimationDelegate* delegate() { return delegate_; }
200 const LayerAnimationDelegate* delegate() const { return delegate_; } 208 const LayerAnimationDelegate* delegate() const { return delegate_; }
201 209
202 // Virtual for testing. 210 // Virtual for testing.
203 virtual void ProgressAnimation(LayerAnimationSequence* sequence, 211 virtual void ProgressAnimation(LayerAnimationSequence* sequence,
204 base::TimeDelta delta); 212 base::TimeDelta delta);
205 213
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 // Observers are notified when layer animations end, are scheduled or are 364 // Observers are notified when layer animations end, are scheduled or are
357 // aborted. 365 // aborted.
358 ObserverList<LayerAnimationObserver> observers_; 366 ObserverList<LayerAnimationObserver> observers_;
359 367
360 DISALLOW_COPY_AND_ASSIGN(LayerAnimator); 368 DISALLOW_COPY_AND_ASSIGN(LayerAnimator);
361 }; 369 };
362 370
363 } // namespace ui 371 } // namespace ui
364 372
365 #endif // UI_COMPOSITOR_LAYER_ANIMATOR_H_ 373 #endif // UI_COMPOSITOR_LAYER_ANIMATOR_H_
OLDNEW
« no previous file with comments | « ui/compositor/layer_animation_timer.h ('k') | ui/compositor/layer_animator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698