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

Side by Side Diff: cc/blink/web_float_animation_curve_impl.cc

Issue 598853003: CC: Add curve (whole animation) timing function to compositor animations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 2 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
OLDNEW
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 "cc/blink/web_float_animation_curve_impl.h" 5 #include "cc/blink/web_float_animation_curve_impl.h"
6 6
7 #include "cc/animation/animation_curve.h" 7 #include "cc/animation/animation_curve.h"
8 #include "cc/animation/keyframed_animation_curve.h" 8 #include "cc/animation/keyframed_animation_curve.h"
9 #include "cc/animation/timing_function.h" 9 #include "cc/animation/timing_function.h"
10 #include "cc/blink/web_animation_curve_common.h" 10 #include "cc/blink/web_animation_curve_common.h"
(...skipping 28 matching lines...) Expand all
39 double x1, 39 double x1,
40 double y1, 40 double y1,
41 double x2, 41 double x2,
42 double y2) { 42 double y2) {
43 curve_->AddKeyframe(cc::FloatKeyframe::Create( 43 curve_->AddKeyframe(cc::FloatKeyframe::Create(
44 keyframe.time, 44 keyframe.time,
45 keyframe.value, 45 keyframe.value,
46 cc::CubicBezierTimingFunction::Create(x1, y1, x2, y2))); 46 cc::CubicBezierTimingFunction::Create(x1, y1, x2, y2)));
47 } 47 }
48 48
49 void WebFloatAnimationCurveImpl::setTimingFunction(TimingFunctionType type) {
50 curve_->SetTimingFunction(CreateTimingFunction(type));
51 }
52
53 void WebFloatAnimationCurveImpl::setTimingFunction(double x1,
54 double y1,
55 double x2,
56 double y2) {
57 curve_->SetTimingFunction(
58 cc::CubicBezierTimingFunction::Create(x1, y1, x2, y2).Pass());
59 }
60
49 float WebFloatAnimationCurveImpl::getValue(double time) const { 61 float WebFloatAnimationCurveImpl::getValue(double time) const {
50 return curve_->GetValue(time); 62 return curve_->GetValue(time);
51 } 63 }
52 64
53 scoped_ptr<cc::AnimationCurve> 65 scoped_ptr<cc::AnimationCurve>
54 WebFloatAnimationCurveImpl::CloneToAnimationCurve() const { 66 WebFloatAnimationCurveImpl::CloneToAnimationCurve() const {
55 return curve_->Clone(); 67 return curve_->Clone();
56 } 68 }
57 69
58 } // namespace cc_blink 70 } // namespace cc_blink
OLDNEW
« no previous file with comments | « cc/blink/web_float_animation_curve_impl.h ('k') | cc/blink/web_transform_animation_curve_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698