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

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

Issue 1616653002: CC Animation: Move files from cc_blink to Source/platform/animation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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_animation_impl.h" 5 #include "cc/blink/web_animation_impl.h"
6 6
7 #include "cc/animation/animation.h" 7 #include "cc/animation/animation.h"
8 #include "cc/animation/animation_curve.h" 8 #include "cc/animation/animation_curve.h"
9 #include "cc/animation/animation_id_provider.h" 9 #include "cc/animation/animation_id_provider.h"
10 #include "cc/blink/web_filter_animation_curve_impl.h" 10 #include "third_party/WebKit/Source/platform/animation/WebCompositorAnimationCur ve.h"
11 #include "cc/blink/web_float_animation_curve_impl.h" 11 #include "third_party/WebKit/Source/platform/animation/WebFilterAnimationCurve.h "
12 #include "cc/blink/web_scroll_offset_animation_curve_impl.h" 12 #include "third_party/WebKit/Source/platform/animation/WebFloatAnimationCurve.h"
13 #include "cc/blink/web_transform_animation_curve_impl.h" 13 #include "third_party/WebKit/Source/platform/animation/WebScrollOffsetAnimationC urve.h"
14 #include "third_party/WebKit/public/platform/WebCompositorAnimationCurve.h" 14 #include "third_party/WebKit/Source/platform/animation/WebTransformAnimationCurv e.h"
loyso (OOO) 2016/01/21 03:55:08 This is a viloation of includes. All the dependent
15 15
16 using cc::Animation; 16 using cc::Animation;
17 using cc::AnimationIdProvider; 17 using cc::AnimationIdProvider;
18 18
19 using blink::WebCompositorAnimation; 19 using blink::WebCompositorAnimation;
20 using blink::WebCompositorAnimationCurve; 20 using blink::WebCompositorAnimationCurve;
21 21
22 namespace cc_blink { 22 namespace cc_blink {
23 23
24 WebCompositorAnimationImpl::WebCompositorAnimationImpl( 24 WebCompositorAnimationImpl::WebCompositorAnimationImpl(
25 const WebCompositorAnimationCurve& web_curve, 25 const WebCompositorAnimationCurve& web_curve,
26 TargetProperty target_property, 26 TargetProperty target_property,
27 int animation_id, 27 int animation_id,
28 int group_id) { 28 int group_id) {
29 if (!animation_id) 29 if (!animation_id)
30 animation_id = AnimationIdProvider::NextAnimationId(); 30 animation_id = AnimationIdProvider::NextAnimationId();
31 if (!group_id) 31 if (!group_id)
32 group_id = AnimationIdProvider::NextGroupId(); 32 group_id = AnimationIdProvider::NextGroupId();
33 33
34 WebCompositorAnimationCurve::AnimationCurveType curve_type = web_curve.type(); 34 WebCompositorAnimationCurve::AnimationCurveType curve_type = web_curve.type();
35 scoped_ptr<cc::AnimationCurve> curve; 35 scoped_ptr<cc::AnimationCurve> curve;
36 switch (curve_type) { 36 switch (curve_type) {
37 case WebCompositorAnimationCurve::AnimationCurveTypeFloat: { 37 case WebCompositorAnimationCurve::AnimationCurveTypeFloat: {
38 const WebFloatAnimationCurveImpl* float_curve_impl = 38 const blink::WebFloatAnimationCurve* float_curve_impl =
39 static_cast<const WebFloatAnimationCurveImpl*>(&web_curve); 39 static_cast<const blink::WebFloatAnimationCurve*>(&web_curve);
40 curve = float_curve_impl->CloneToAnimationCurve(); 40 curve = float_curve_impl->CloneToAnimationCurve();
41 break; 41 break;
42 } 42 }
43 case WebCompositorAnimationCurve::AnimationCurveTypeTransform: { 43 case WebCompositorAnimationCurve::AnimationCurveTypeTransform: {
44 const WebTransformAnimationCurveImpl* transform_curve_impl = 44 const blink::WebTransformAnimationCurve* transform_curve_impl =
45 static_cast<const WebTransformAnimationCurveImpl*>(&web_curve); 45 static_cast<const blink::WebTransformAnimationCurve*>(&web_curve);
46 curve = transform_curve_impl->CloneToAnimationCurve(); 46 curve = transform_curve_impl->CloneToAnimationCurve();
47 break; 47 break;
48 } 48 }
49 case WebCompositorAnimationCurve::AnimationCurveTypeFilter: { 49 case WebCompositorAnimationCurve::AnimationCurveTypeFilter: {
50 const WebFilterAnimationCurveImpl* filter_curve_impl = 50 const blink::WebFilterAnimationCurve* filter_curve_impl =
51 static_cast<const WebFilterAnimationCurveImpl*>(&web_curve); 51 static_cast<const blink::WebFilterAnimationCurve*>(&web_curve);
52 curve = filter_curve_impl->CloneToAnimationCurve(); 52 curve = filter_curve_impl->CloneToAnimationCurve();
53 break; 53 break;
54 } 54 }
55 case WebCompositorAnimationCurve::AnimationCurveTypeScrollOffset: { 55 case WebCompositorAnimationCurve::AnimationCurveTypeScrollOffset: {
56 const WebScrollOffsetAnimationCurveImpl* scroll_curve_impl = 56 const blink::WebScrollOffsetAnimationCurve* scroll_curve_impl =
57 static_cast<const WebScrollOffsetAnimationCurveImpl*>(&web_curve); 57 static_cast<const blink::WebScrollOffsetAnimationCurve*>(&web_curve);
58 curve = scroll_curve_impl->CloneToAnimationCurve(); 58 curve = scroll_curve_impl->CloneToAnimationCurve();
59 break; 59 break;
60 } 60 }
61 } 61 }
62 animation_ = Animation::Create( 62 animation_ = Animation::Create(
63 std::move(curve), animation_id, group_id, 63 std::move(curve), animation_id, group_id,
64 static_cast<cc::Animation::TargetProperty>(target_property)); 64 static_cast<cc::Animation::TargetProperty>(target_property));
65 } 65 }
66 66
67 WebCompositorAnimationImpl::~WebCompositorAnimationImpl() { 67 WebCompositorAnimationImpl::~WebCompositorAnimationImpl() {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 break; 189 break;
190 } 190 }
191 } 191 }
192 192
193 scoped_ptr<cc::Animation> WebCompositorAnimationImpl::PassAnimation() { 193 scoped_ptr<cc::Animation> WebCompositorAnimationImpl::PassAnimation() {
194 animation_->set_needs_synchronized_start_time(true); 194 animation_->set_needs_synchronized_start_time(true);
195 return std::move(animation_); 195 return std::move(animation_);
196 } 196 }
197 197
198 } // namespace cc_blink 198 } // namespace cc_blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698