| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "ui/gfx/compositor/layer_animation_element.h" | 5 #include "ui/gfx/compositor/layer_animation_element.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "ui/base/animation/tween.h" | 8 #include "ui/base/animation/tween.h" |
| 9 #include "ui/gfx/compositor/layer_animation_delegate.h" | 9 #include "ui/gfx/compositor/layer_animation_delegate.h" |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 target_(target) { | 39 target_(target) { |
| 40 } | 40 } |
| 41 virtual ~TransformTransition() {} | 41 virtual ~TransformTransition() {} |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE { | 44 virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE { |
| 45 start_ = delegate->GetTransformForAnimation(); | 45 start_ = delegate->GetTransformForAnimation(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 virtual void OnProgress(double t, LayerAnimationDelegate* delegate) OVERRIDE { | 48 virtual void OnProgress(double t, LayerAnimationDelegate* delegate) OVERRIDE { |
| 49 #if !defined(OS_MACOSX) |
| 49 delegate->SetTransformFromAnimation( | 50 delegate->SetTransformFromAnimation( |
| 50 Tween::ValueBetween(t, start_, target_)); | 51 Tween::ValueBetween(t, start_, target_)); |
| 52 #endif |
| 51 } | 53 } |
| 52 | 54 |
| 53 virtual void OnGetTarget(TargetValue* target) const OVERRIDE { | 55 virtual void OnGetTarget(TargetValue* target) const OVERRIDE { |
| 54 target->transform = target_; | 56 target->transform = target_; |
| 55 } | 57 } |
| 56 | 58 |
| 57 virtual void OnAbort() OVERRIDE {} | 59 virtual void OnAbort() OVERRIDE {} |
| 58 | 60 |
| 59 private: | 61 private: |
| 60 static const AnimatableProperties& GetProperties() { | 62 static const AnimatableProperties& GetProperties() { |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 return new OpacityTransition(opacity, duration); | 212 return new OpacityTransition(opacity, duration); |
| 211 } | 213 } |
| 212 | 214 |
| 213 // static | 215 // static |
| 214 LayerAnimationElement* LayerAnimationElement::CreatePauseElement( | 216 LayerAnimationElement* LayerAnimationElement::CreatePauseElement( |
| 215 const AnimatableProperties& properties, base::TimeDelta duration) { | 217 const AnimatableProperties& properties, base::TimeDelta duration) { |
| 216 return new Pause(properties, duration); | 218 return new Pause(properties, duration); |
| 217 } | 219 } |
| 218 | 220 |
| 219 } // namespace ui | 221 } // namespace ui |
| OLD | NEW |