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

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

Issue 140253013: Define accelerated steps time function. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated patch: remove question about velocity Created 6 years, 3 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
« no previous file with comments | « cc/blink/web_transform_animation_curve_impl.h ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_transform_animation_curve_impl.h" 5 #include "cc/blink/web_transform_animation_curve_impl.h"
6 6
7 #include "cc/animation/keyframed_animation_curve.h" 7 #include "cc/animation/keyframed_animation_curve.h"
8 #include "cc/animation/timing_function.h" 8 #include "cc/animation/timing_function.h"
9 #include "cc/animation/transform_operations.h" 9 #include "cc/animation/transform_operations.h"
10 #include "cc/blink/web_animation_curve_common.h" 10 #include "cc/blink/web_animation_curve_common.h"
(...skipping 22 matching lines...) Expand all
33 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe, 33 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe,
34 TimingFunctionType type) { 34 TimingFunctionType type) {
35 const cc::TransformOperations& transform_operations = 35 const cc::TransformOperations& transform_operations =
36 static_cast<const WebTransformOperationsImpl&>(keyframe.value()) 36 static_cast<const WebTransformOperationsImpl&>(keyframe.value())
37 .AsTransformOperations(); 37 .AsTransformOperations();
38 curve_->AddKeyframe(cc::TransformKeyframe::Create( 38 curve_->AddKeyframe(cc::TransformKeyframe::Create(
39 keyframe.time(), transform_operations, CreateTimingFunction(type))); 39 keyframe.time(), transform_operations, CreateTimingFunction(type)));
40 } 40 }
41 41
42 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe, 42 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe,
43 int steps,
44 bool steps_at_start) {
45 const cc::TransformOperations& transform_operations =
46 static_cast<const WebTransformOperationsImpl&>(keyframe.value())
47 .AsTransformOperations();
48 curve_->AddKeyframe(cc::TransformKeyframe::Create(
49 keyframe.time(),
50 transform_operations,
51 cc::StepsTimingFunction::Create(steps, steps_at_start)
52 .PassAs<cc::TimingFunction>()));
53 }
54
55 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe,
43 double x1, 56 double x1,
44 double y1, 57 double y1,
45 double x2, 58 double x2,
46 double y2) { 59 double y2) {
47 const cc::TransformOperations& transform_operations = 60 const cc::TransformOperations& transform_operations =
48 static_cast<const WebTransformOperationsImpl&>(keyframe.value()) 61 static_cast<const WebTransformOperationsImpl&>(keyframe.value())
49 .AsTransformOperations(); 62 .AsTransformOperations();
50 curve_->AddKeyframe(cc::TransformKeyframe::Create( 63 curve_->AddKeyframe(cc::TransformKeyframe::Create(
51 keyframe.time(), 64 keyframe.time(),
52 transform_operations, 65 transform_operations,
53 cc::CubicBezierTimingFunction::Create(x1, y1, x2, y2) 66 cc::CubicBezierTimingFunction::Create(x1, y1, x2, y2)
54 .PassAs<cc::TimingFunction>())); 67 .PassAs<cc::TimingFunction>()));
55 } 68 }
56 69
57 scoped_ptr<cc::AnimationCurve> 70 scoped_ptr<cc::AnimationCurve>
58 WebTransformAnimationCurveImpl::CloneToAnimationCurve() const { 71 WebTransformAnimationCurveImpl::CloneToAnimationCurve() const {
59 return curve_->Clone(); 72 return curve_->Clone();
60 } 73 }
61 74
62 } // namespace cc_blink 75 } // namespace cc_blink
OLDNEW
« no previous file with comments | « cc/blink/web_transform_animation_curve_impl.h ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698