| Index: ui/gfx/compositor/layer_animation_element.cc
|
| diff --git a/ui/gfx/compositor/layer_animation_element.cc b/ui/gfx/compositor/layer_animation_element.cc
|
| index fb52bbb3c14c5829091fb7a1af0f17a8dae6e3ec..abff5f66dbc2a9406d043a6a8ec29169d1850e16 100644
|
| --- a/ui/gfx/compositor/layer_animation_element.cc
|
| +++ b/ui/gfx/compositor/layer_animation_element.cc
|
| @@ -7,8 +7,6 @@
|
| #include "base/compiler_specific.h"
|
| #include "ui/base/animation/tween.h"
|
| #include "ui/gfx/compositor/layer_animation_delegate.h"
|
| -#include "ui/gfx/rect.h"
|
| -#include "ui/gfx/transform.h"
|
|
|
| namespace ui {
|
|
|
| @@ -26,6 +24,7 @@ class Pause : public LayerAnimationElement {
|
| virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE {}
|
| virtual void OnProgress(double t,
|
| LayerAnimationDelegate* delegate) OVERRIDE {}
|
| + virtual void OnGetTarget(TargetValue* target) const OVERRIDE {}
|
| virtual void OnAbort() OVERRIDE {}
|
|
|
| DISALLOW_COPY_AND_ASSIGN(Pause);
|
| @@ -51,6 +50,10 @@ class TransformTransition : public LayerAnimationElement {
|
| Tween::ValueBetween(t, start_, target_));
|
| }
|
|
|
| + virtual void OnGetTarget(TargetValue* target) const OVERRIDE {
|
| + target->transform = target_;
|
| + }
|
| +
|
| virtual void OnAbort() OVERRIDE {}
|
|
|
| private:
|
| @@ -86,6 +89,10 @@ class BoundsTransition : public LayerAnimationElement {
|
| delegate->SetBoundsFromAnimation(Tween::ValueBetween(t, start_, target_));
|
| }
|
|
|
| + virtual void OnGetTarget(TargetValue* target) const OVERRIDE {
|
| + target->bounds = target_;
|
| + }
|
| +
|
| virtual void OnAbort() OVERRIDE {}
|
|
|
| private:
|
| @@ -119,6 +126,10 @@ class OpacityTransition : public LayerAnimationElement {
|
| delegate->SetOpacityFromAnimation(Tween::ValueBetween(t, start_, target_));
|
| }
|
|
|
| + virtual void OnGetTarget(TargetValue* target) const OVERRIDE {
|
| + target->opacity = target_;
|
| + }
|
| +
|
| virtual void OnAbort() OVERRIDE {}
|
|
|
| private:
|
| @@ -137,6 +148,11 @@ class OpacityTransition : public LayerAnimationElement {
|
|
|
| } // namespace
|
|
|
| +// LayerAnimationElement::TargetValue ------------------------------------------
|
| +
|
| +LayerAnimationElement::TargetValue::TargetValue() : opacity(0.0f) {
|
| +}
|
| +
|
| // LayerAnimationElement -------------------------------------------------------
|
|
|
| LayerAnimationElement::LayerAnimationElement(
|
| @@ -155,9 +171,14 @@ void LayerAnimationElement::Progress(double t,
|
| if (first_frame_)
|
| OnStart(delegate);
|
| OnProgress(t, delegate);
|
| + delegate->ScheduleDrawForAnimation();
|
| first_frame_ = t == 1.0;
|
| }
|
|
|
| +void LayerAnimationElement::GetTargetValue(TargetValue* target) const {
|
| + OnGetTarget(target);
|
| +}
|
| +
|
| void LayerAnimationElement::Abort() {
|
| first_frame_ = true;
|
| OnAbort();
|
|
|