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

Side by Side Diff: webkit/compositor_bindings/web_animation_impl.cc

Issue 12517003: cc: Chromify the Animation and LayerAnimationController classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include "webkit/compositor_bindings/web_animation_impl.h" 5 #include "webkit/compositor_bindings/web_animation_impl.h"
6 6
7 #include "cc/animation.h" 7 #include "cc/animation.h"
8 #include "cc/animation_curve.h" 8 #include "cc/animation_curve.h"
9 #include "cc/animation_id_provider.h" 9 #include "cc/animation_id_provider.h"
10 #include "third_party/WebKit/Source/Platform/chromium/public/WebAnimationCurve.h " 10 #include "third_party/WebKit/Source/Platform/chromium/public/WebAnimationCurve.h "
(...skipping 24 matching lines...) Expand all
35 curve = float_curve_impl->cloneToAnimationCurve(); 35 curve = float_curve_impl->cloneToAnimationCurve();
36 break; 36 break;
37 } 37 }
38 case WebAnimationCurve::AnimationCurveTypeTransform: { 38 case WebAnimationCurve::AnimationCurveTypeTransform: {
39 const WebTransformAnimationCurveImpl* transform_curve_impl = 39 const WebTransformAnimationCurveImpl* transform_curve_impl =
40 static_cast<const WebTransformAnimationCurveImpl*>(&web_curve); 40 static_cast<const WebTransformAnimationCurveImpl*>(&web_curve);
41 curve = transform_curve_impl->cloneToAnimationCurve(); 41 curve = transform_curve_impl->cloneToAnimationCurve();
42 break; 42 break;
43 } 43 }
44 } 44 }
45 animation_ = Animation::create( 45 animation_ = Animation::Create(
46 curve.Pass(), 46 curve.Pass(),
47 animation_id, 47 animation_id,
48 group_id, 48 group_id,
49 static_cast<cc::Animation::TargetProperty>(target_property)); 49 static_cast<cc::Animation::TargetProperty>(target_property));
50 } 50 }
51 51
52 WebAnimationImpl::~WebAnimationImpl() {} 52 WebAnimationImpl::~WebAnimationImpl() {}
53 53
54 int WebAnimationImpl::id() { return animation_->id(); } 54 int WebAnimationImpl::id() { return animation_->id(); }
55 55
56 WebAnimation::TargetProperty WebAnimationImpl::targetProperty() const { 56 WebAnimation::TargetProperty WebAnimationImpl::targetProperty() const {
57 return static_cast<WebAnimationImpl::TargetProperty>( 57 return static_cast<WebAnimationImpl::TargetProperty>(
58 animation_->targetProperty()); 58 animation_->target_property());
59 } 59 }
60 60
61 int WebAnimationImpl::iterations() const { return animation_->iterations(); } 61 int WebAnimationImpl::iterations() const { return animation_->iterations(); }
62 62
63 void WebAnimationImpl::setIterations(int n) { animation_->setIterations(n); } 63 void WebAnimationImpl::setIterations(int n) { animation_->set_iterations(n); }
64 64
65 double WebAnimationImpl::startTime() const { return animation_->startTime(); } 65 double WebAnimationImpl::startTime() const { return animation_->start_time(); }
66 66
67 void WebAnimationImpl::setStartTime(double monotonic_time) { 67 void WebAnimationImpl::setStartTime(double monotonic_time) {
68 animation_->setStartTime(monotonic_time); 68 animation_->set_start_time(monotonic_time);
69 } 69 }
70 70
71 double WebAnimationImpl::timeOffset() const { return animation_->timeOffset(); } 71 double WebAnimationImpl::timeOffset() const {
72 return animation_->time_offset();
73 }
72 74
73 void WebAnimationImpl::setTimeOffset(double monotonic_time) { 75 void WebAnimationImpl::setTimeOffset(double monotonic_time) {
74 animation_->setTimeOffset(monotonic_time); 76 animation_->set_time_offset(monotonic_time);
75 } 77 }
76 78
77 bool WebAnimationImpl::alternatesDirection() const { 79 bool WebAnimationImpl::alternatesDirection() const {
78 return animation_->alternatesDirection(); 80 return animation_->alternates_direction();
79 } 81 }
80 82
81 void WebAnimationImpl::setAlternatesDirection(bool alternates) { 83 void WebAnimationImpl::setAlternatesDirection(bool alternates) {
82 animation_->setAlternatesDirection(alternates); 84 animation_->set_alternates_direction(alternates);
83 } 85 }
84 86
85 scoped_ptr<cc::Animation> WebAnimationImpl::cloneToAnimation() { 87 scoped_ptr<cc::Animation> WebAnimationImpl::cloneToAnimation() {
86 scoped_ptr<cc::Animation> to_return( 88 scoped_ptr<cc::Animation> to_return(
87 animation_->clone(cc::Animation::NonControllingInstance)); 89 animation_->Clone(cc::Animation::NonControllingInstance));
88 to_return->setNeedsSynchronizedStartTime(true); 90 to_return->set_needs_synchronized_start_time(true);
89 return to_return.Pass(); 91 return to_return.Pass();
90 } 92 }
91 93
92 } // namespace WebKit 94 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698