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

Side by Side Diff: trunk/src/webkit/renderer/compositor_bindings/web_animation_impl.cc

Issue 141953013: Revert 245663 "Revert 245645 "Define WebScrollOffsetAnimationCur..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_animation_impl.h" 5 #include "webkit/renderer/compositor_bindings/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 "third_party/WebKit/public/platform/WebAnimation.h" 10 #include "third_party/WebKit/public/platform/WebAnimation.h"
11 #include "third_party/WebKit/public/platform/WebAnimationCurve.h" 11 #include "third_party/WebKit/public/platform/WebAnimationCurve.h"
12 #include "webkit/renderer/compositor_bindings/web_filter_animation_curve_impl.h" 12 #include "webkit/renderer/compositor_bindings/web_filter_animation_curve_impl.h"
13 #include "webkit/renderer/compositor_bindings/web_float_animation_curve_impl.h" 13 #include "webkit/renderer/compositor_bindings/web_float_animation_curve_impl.h"
14 #include "webkit/renderer/compositor_bindings/web_scroll_offset_animation_curve_ impl.h"
14 #include "webkit/renderer/compositor_bindings/web_transform_animation_curve_impl .h" 15 #include "webkit/renderer/compositor_bindings/web_transform_animation_curve_impl .h"
15 16
16 using cc::Animation; 17 using cc::Animation;
17 using cc::AnimationIdProvider; 18 using cc::AnimationIdProvider;
18 19
19 using blink::WebAnimation; 20 using blink::WebAnimation;
20 using blink::WebAnimationCurve; 21 using blink::WebAnimationCurve;
21 22
22 namespace webkit { 23 namespace webkit {
23 24
(...skipping 20 matching lines...) Expand all
44 static_cast<const WebTransformAnimationCurveImpl*>(&web_curve); 45 static_cast<const WebTransformAnimationCurveImpl*>(&web_curve);
45 curve = transform_curve_impl->CloneToAnimationCurve(); 46 curve = transform_curve_impl->CloneToAnimationCurve();
46 break; 47 break;
47 } 48 }
48 case WebAnimationCurve::AnimationCurveTypeFilter: { 49 case WebAnimationCurve::AnimationCurveTypeFilter: {
49 const WebFilterAnimationCurveImpl* filter_curve_impl = 50 const WebFilterAnimationCurveImpl* filter_curve_impl =
50 static_cast<const WebFilterAnimationCurveImpl*>(&web_curve); 51 static_cast<const WebFilterAnimationCurveImpl*>(&web_curve);
51 curve = filter_curve_impl->CloneToAnimationCurve(); 52 curve = filter_curve_impl->CloneToAnimationCurve();
52 break; 53 break;
53 } 54 }
55 #if WEB_SCROLL_OFFSET_ANIMATION_CURVE_IS_DEFINED
56 case WebAnimationCurve::AnimationCurveTypeScrollOffset: {
57 const WebScrollOffsetAnimationCurveImpl* scroll_curve_impl =
58 static_cast<const WebScrollOffsetAnimationCurveImpl*>(&web_curve);
59 curve = scroll_curve_impl->CloneToAnimationCurve();
60 break;
61 }
62 #endif
54 } 63 }
55 animation_ = Animation::Create( 64 animation_ = Animation::Create(
56 curve.Pass(), 65 curve.Pass(),
57 animation_id, 66 animation_id,
58 group_id, 67 group_id,
59 static_cast<cc::Animation::TargetProperty>(target_property)); 68 static_cast<cc::Animation::TargetProperty>(target_property));
60 } 69 }
61 70
62 WebAnimationImpl::~WebAnimationImpl() {} 71 WebAnimationImpl::~WebAnimationImpl() {}
63 72
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 #define COMPILE_ASSERT_MATCHING_ENUMS(webkit_name, cc_name) \ 111 #define COMPILE_ASSERT_MATCHING_ENUMS(webkit_name, cc_name) \
103 COMPILE_ASSERT(static_cast<int>(webkit_name) == static_cast<int>(cc_name), \ 112 COMPILE_ASSERT(static_cast<int>(webkit_name) == static_cast<int>(cc_name), \
104 mismatching_enums) 113 mismatching_enums)
105 114
106 COMPILE_ASSERT_MATCHING_ENUMS( 115 COMPILE_ASSERT_MATCHING_ENUMS(
107 WebAnimation::TargetPropertyTransform, Animation::Transform); 116 WebAnimation::TargetPropertyTransform, Animation::Transform);
108 COMPILE_ASSERT_MATCHING_ENUMS( 117 COMPILE_ASSERT_MATCHING_ENUMS(
109 WebAnimation::TargetPropertyOpacity, Animation::Opacity); 118 WebAnimation::TargetPropertyOpacity, Animation::Opacity);
110 COMPILE_ASSERT_MATCHING_ENUMS( 119 COMPILE_ASSERT_MATCHING_ENUMS(
111 WebAnimation::TargetPropertyFilter, Animation::Filter); 120 WebAnimation::TargetPropertyFilter, Animation::Filter);
121 #if WEB_SCROLL_OFFSET_ANIMATION_CURVE_IS_DEFINED
122 COMPILE_ASSERT_MATCHING_ENUMS(
123 WebAnimation::TargetPropertyScrollOffset, Animation::ScrollOffset);
124 #endif
112 125
113 } // namespace webkit 126 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698