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

Side by Side Diff: webkit/renderer/compositor_bindings/web_filter_animation_curve_impl.cc

Issue 317163002: Moving compositor_bindings from webkit to content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changing dependencies due to failing ios bots Created 6 years, 6 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
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "webkit/renderer/compositor_bindings/web_filter_animation_curve_impl.h"
6
7 #include "cc/animation/keyframed_animation_curve.h"
8 #include "cc/animation/timing_function.h"
9 #include "cc/output/filter_operations.h"
10 #include "webkit/renderer/compositor_bindings/web_animation_curve_common.h"
11 #include "webkit/renderer/compositor_bindings/web_filter_operations_impl.h"
12
13 using blink::WebFilterKeyframe;
14
15 namespace webkit {
16
17 WebFilterAnimationCurveImpl::WebFilterAnimationCurveImpl()
18 : curve_(cc::KeyframedFilterAnimationCurve::Create()) {}
19
20 WebFilterAnimationCurveImpl::~WebFilterAnimationCurveImpl() {}
21
22 blink::WebAnimationCurve::AnimationCurveType
23 WebFilterAnimationCurveImpl::type() const {
24 return WebAnimationCurve::AnimationCurveTypeFilter;
25 }
26
27 void WebFilterAnimationCurveImpl::add(const WebFilterKeyframe& keyframe,
28 TimingFunctionType type) {
29 const cc::FilterOperations& filter_operations =
30 static_cast<const webkit::WebFilterOperationsImpl&>(keyframe.value())
31 .AsFilterOperations();
32 curve_->AddKeyframe(cc::FilterKeyframe::Create(
33 keyframe.time(), filter_operations, CreateTimingFunction(type)));
34 }
35
36 void WebFilterAnimationCurveImpl::add(const WebFilterKeyframe& keyframe,
37 double x1,
38 double y1,
39 double x2,
40 double y2) {
41 const cc::FilterOperations& filter_operations =
42 static_cast<const webkit::WebFilterOperationsImpl&>(keyframe.value())
43 .AsFilterOperations();
44 curve_->AddKeyframe(cc::FilterKeyframe::Create(
45 keyframe.time(),
46 filter_operations,
47 cc::CubicBezierTimingFunction::Create(x1, y1, x2, y2)
48 .PassAs<cc::TimingFunction>()));
49 }
50
51 scoped_ptr<cc::AnimationCurve>
52 WebFilterAnimationCurveImpl::CloneToAnimationCurve() const {
53 return curve_->Clone();
54 }
55
56 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698