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

Side by Side Diff: content/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: Using layouttest_support to instantiate WebLayer 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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/renderer/compositor_bindings/web_filter_animation_curve_impl.h" 5 #include "content/renderer/compositor_bindings/web_filter_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/output/filter_operations.h" 9 #include "cc/output/filter_operations.h"
10 #include "webkit/renderer/compositor_bindings/web_animation_curve_common.h" 10 #include "content/renderer/compositor_bindings/web_animation_curve_common.h"
11 #include "webkit/renderer/compositor_bindings/web_filter_operations_impl.h" 11 #include "content/renderer/compositor_bindings/web_filter_operations_impl.h"
12 12
13 using blink::WebFilterKeyframe; 13 using blink::WebFilterKeyframe;
14 14
15 namespace webkit { 15 namespace content {
16 16
17 WebFilterAnimationCurveImpl::WebFilterAnimationCurveImpl() 17 WebFilterAnimationCurveImpl::WebFilterAnimationCurveImpl()
18 : curve_(cc::KeyframedFilterAnimationCurve::Create()) {} 18 : curve_(cc::KeyframedFilterAnimationCurve::Create()) {
19 }
19 20
20 WebFilterAnimationCurveImpl::~WebFilterAnimationCurveImpl() {} 21 WebFilterAnimationCurveImpl::~WebFilterAnimationCurveImpl() {
22 }
21 23
22 blink::WebAnimationCurve::AnimationCurveType 24 blink::WebAnimationCurve::AnimationCurveType WebFilterAnimationCurveImpl::type()
23 WebFilterAnimationCurveImpl::type() const { 25 const {
24 return WebAnimationCurve::AnimationCurveTypeFilter; 26 return WebAnimationCurve::AnimationCurveTypeFilter;
25 } 27 }
26 28
27 void WebFilterAnimationCurveImpl::add(const WebFilterKeyframe& keyframe, 29 void WebFilterAnimationCurveImpl::add(const WebFilterKeyframe& keyframe,
28 TimingFunctionType type) { 30 TimingFunctionType type) {
29 const cc::FilterOperations& filter_operations = 31 const cc::FilterOperations& filter_operations =
30 static_cast<const webkit::WebFilterOperationsImpl&>(keyframe.value()) 32 static_cast<const content::WebFilterOperationsImpl&>(keyframe.value())
jam 2014/06/11 00:27:04 nit: here and below, no "content::" inside content
31 .AsFilterOperations(); 33 .AsFilterOperations();
32 curve_->AddKeyframe(cc::FilterKeyframe::Create( 34 curve_->AddKeyframe(cc::FilterKeyframe::Create(
33 keyframe.time(), filter_operations, CreateTimingFunction(type))); 35 keyframe.time(), filter_operations, CreateTimingFunction(type)));
34 } 36 }
35 37
36 void WebFilterAnimationCurveImpl::add(const WebFilterKeyframe& keyframe, 38 void WebFilterAnimationCurveImpl::add(const WebFilterKeyframe& keyframe,
37 double x1, 39 double x1,
38 double y1, 40 double y1,
39 double x2, 41 double x2,
40 double y2) { 42 double y2) {
41 const cc::FilterOperations& filter_operations = 43 const cc::FilterOperations& filter_operations =
42 static_cast<const webkit::WebFilterOperationsImpl&>(keyframe.value()) 44 static_cast<const content::WebFilterOperationsImpl&>(keyframe.value())
43 .AsFilterOperations(); 45 .AsFilterOperations();
44 curve_->AddKeyframe(cc::FilterKeyframe::Create( 46 curve_->AddKeyframe(cc::FilterKeyframe::Create(
45 keyframe.time(), 47 keyframe.time(),
46 filter_operations, 48 filter_operations,
47 cc::CubicBezierTimingFunction::Create(x1, y1, x2, y2) 49 cc::CubicBezierTimingFunction::Create(x1, y1, x2, y2)
48 .PassAs<cc::TimingFunction>())); 50 .PassAs<cc::TimingFunction>()));
49 } 51 }
50 52
51 scoped_ptr<cc::AnimationCurve> 53 scoped_ptr<cc::AnimationCurve>
52 WebFilterAnimationCurveImpl::CloneToAnimationCurve() const { 54 WebFilterAnimationCurveImpl::CloneToAnimationCurve() const {
53 return curve_->Clone(); 55 return curve_->Clone();
54 } 56 }
55 57
56 } // namespace webkit 58 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698