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

Unified Diff: ui/compositor/layer_animation_element.h

Issue 11316315: Remove ui::LayerAnimationSequence::duration and ui::LayerAnimationElement::duration. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Make unit tests use IsFinished() instead of duration() Created 8 years 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
« no previous file with comments | « no previous file | ui/compositor/layer_animation_element.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_animation_element.h
diff --git a/ui/compositor/layer_animation_element.h b/ui/compositor/layer_animation_element.h
index 46aedb7750454b166cf8691858c6a19503873569..2a80698f15cd6be0e50cfc6f377d253b2cc25afe 100644
--- a/ui/compositor/layer_animation_element.h
+++ b/ui/compositor/layer_animation_element.h
@@ -113,11 +113,18 @@ class COMPOSITOR_EXPORT LayerAnimationElement {
SkColor color,
base::TimeDelta duration);
- // Updates the delegate to the appropriate value for |t|, which is in the
- // range [0, 1] (0 for initial, and 1 for final). If the animation is not
- // aborted, it is guaranteed that Progress will eventually be called with
- // t = 1.0. Returns true if a redraw is required.
- bool Progress(double t, LayerAnimationDelegate* delegate);
+ // Updates the delegate to the appropriate value for |elapsed|. Returns true
+ // if a redraw is required.
+ bool Progress(base::TimeDelta elapsed, LayerAnimationDelegate* delegate);
+
+ // If calling Progress now, with the given elapsed time, will finish the
+ // animation, returns true and sets |total_duration| to the actual duration
+ // for this animation, incuding any queueing delays.
+ bool IsFinished(base::TimeDelta elapsed, base::TimeDelta* total_duration);
+
+ // Updates the delegate to the end of the animation. Returns true if a
+ // redraw is required.
+ bool ProgressToEnd(LayerAnimationDelegate* delegate);
// Called if the animation is not allowed to complete. This may be called
// before OnStarted or Progress.
@@ -129,9 +136,6 @@ class COMPOSITOR_EXPORT LayerAnimationElement {
// The properties that the element modifies.
const AnimatableProperties& properties() const { return properties_; }
- // The duration of the animation
- base::TimeDelta duration() const { return duration_; }
-
Tween::Type tween_type() const { return tween_type_; }
void set_tween_type(Tween::Type tween_type) { tween_type_ = tween_type; }
« no previous file with comments | « no previous file | ui/compositor/layer_animation_element.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698