| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "sky/viewer/cc/web_animation_impl.h" | 5 #include "sky/viewer/cc/web_animation_impl.h" |
| 6 | 6 |
| 7 #include "cc/animation/animation.h" | 7 #include "cc/animation/animation.h" |
| 8 #include "cc/animation/animation_curve.h" | 8 #include "cc/animation/animation_curve.h" |
| 9 #include "cc/animation/animation_id_provider.h" | 9 #include "cc/animation/animation_id_provider.h" |
| 10 #include "sky/viewer/cc/web_filter_animation_curve_impl.h" | 10 #include "sky/viewer/cc/web_filter_animation_curve_impl.h" |
| 11 #include "sky/viewer/cc/web_float_animation_curve_impl.h" | 11 #include "sky/viewer/cc/web_float_animation_curve_impl.h" |
| 12 #include "sky/viewer/cc/web_scroll_offset_animation_curve_impl.h" | |
| 13 #include "sky/viewer/cc/web_transform_animation_curve_impl.h" | 12 #include "sky/viewer/cc/web_transform_animation_curve_impl.h" |
| 14 #include "sky/engine/public/platform/WebCompositorAnimationCurve.h" | 13 #include "sky/engine/public/platform/WebCompositorAnimationCurve.h" |
| 15 | 14 |
| 16 using cc::Animation; | 15 using cc::Animation; |
| 17 using cc::AnimationIdProvider; | 16 using cc::AnimationIdProvider; |
| 18 | 17 |
| 19 using blink::WebCompositorAnimation; | 18 using blink::WebCompositorAnimation; |
| 20 using blink::WebCompositorAnimationCurve; | 19 using blink::WebCompositorAnimationCurve; |
| 21 | 20 |
| 22 namespace sky_viewer_cc { | 21 namespace sky_viewer_cc { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 45 static_cast<const WebTransformAnimationCurveImpl*>(&web_curve); | 44 static_cast<const WebTransformAnimationCurveImpl*>(&web_curve); |
| 46 curve = transform_curve_impl->CloneToAnimationCurve(); | 45 curve = transform_curve_impl->CloneToAnimationCurve(); |
| 47 break; | 46 break; |
| 48 } | 47 } |
| 49 case WebCompositorAnimationCurve::AnimationCurveTypeFilter: { | 48 case WebCompositorAnimationCurve::AnimationCurveTypeFilter: { |
| 50 const WebFilterAnimationCurveImpl* filter_curve_impl = | 49 const WebFilterAnimationCurveImpl* filter_curve_impl = |
| 51 static_cast<const WebFilterAnimationCurveImpl*>(&web_curve); | 50 static_cast<const WebFilterAnimationCurveImpl*>(&web_curve); |
| 52 curve = filter_curve_impl->CloneToAnimationCurve(); | 51 curve = filter_curve_impl->CloneToAnimationCurve(); |
| 53 break; | 52 break; |
| 54 } | 53 } |
| 55 case WebCompositorAnimationCurve::AnimationCurveTypeScrollOffset: { | |
| 56 const WebScrollOffsetAnimationCurveImpl* scroll_curve_impl = | |
| 57 static_cast<const WebScrollOffsetAnimationCurveImpl*>(&web_curve); | |
| 58 curve = scroll_curve_impl->CloneToAnimationCurve(); | |
| 59 break; | |
| 60 } | |
| 61 } | 54 } |
| 62 animation_ = Animation::Create( | 55 animation_ = Animation::Create( |
| 63 curve.Pass(), | 56 curve.Pass(), |
| 64 animation_id, | 57 animation_id, |
| 65 group_id, | 58 group_id, |
| 66 static_cast<cc::Animation::TargetProperty>(target_property)); | 59 static_cast<cc::Animation::TargetProperty>(target_property)); |
| 67 } | 60 } |
| 68 | 61 |
| 69 WebCompositorAnimationImpl::~WebCompositorAnimationImpl() { | 62 WebCompositorAnimationImpl::~WebCompositorAnimationImpl() { |
| 70 } | 63 } |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 void WebCompositorAnimationImpl::setPlaybackRate(double playback_rate) { | 161 void WebCompositorAnimationImpl::setPlaybackRate(double playback_rate) { |
| 169 animation_->set_playback_rate(playback_rate); | 162 animation_->set_playback_rate(playback_rate); |
| 170 } | 163 } |
| 171 | 164 |
| 172 scoped_ptr<cc::Animation> WebCompositorAnimationImpl::PassAnimation() { | 165 scoped_ptr<cc::Animation> WebCompositorAnimationImpl::PassAnimation() { |
| 173 animation_->set_needs_synchronized_start_time(true); | 166 animation_->set_needs_synchronized_start_time(true); |
| 174 return animation_.Pass(); | 167 return animation_.Pass(); |
| 175 } | 168 } |
| 176 | 169 |
| 177 } // namespace sky_viewer_cc | 170 } // namespace sky_viewer_cc |
| OLD | NEW |