diff options
author | ajuma@chromium.org <ajuma@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-17 00:40:27 +0000 |
---|---|---|
committer | ajuma@chromium.org <ajuma@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-17 00:40:27 +0000 |
commit | 83ef2bc18a113f83009dd63dfe1e76adedcef8fa (patch) | |
tree | ddff547759ed096f3fe40c7ca76432635c053541 /cc/keyframed_animation_curve_unittest.cc | |
parent | 3077f9925d15fe614ec2059da6450f8e516047b3 (diff) | |
download | chromium_src-83ef2bc18a113f83009dd63dfe1e76adedcef8fa.zip chromium_src-83ef2bc18a113f83009dd63dfe1e76adedcef8fa.tar.gz chromium_src-83ef2bc18a113f83009dd63dfe1e76adedcef8fa.tar.bz2 |
Define cc::TransformOperations and webkit::WebTransformOperationsImpl
This ports the implementation of WebTransformOperations into cc::TransformOperations, Also, behind #if WEB_TRANSFORM_OPERATIONS_IS_VIRTUAL, this makes cc use TransformOperations instead of WebTransformOperations; defines a new class WebTransformOperationsImpl that implements WebTransformOperations using an instance of cc::TransformOperations; defines WebCompositorSupportImpl::createTransformOperations; and makes compositor_bindings use WebTransformOperationsImpl instead of WebTransformOperations (extracting the underlying cc::TransformOperations before calling into cc).
This is step 1 of the 3-step plan outlined at https://chromiumcodereview.appspot.com/11745018 for moving the implementation of WebTransformOperations into chromium.
BUG=166640
Review URL: https://chromiumcodereview.appspot.com/11876016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177290 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/keyframed_animation_curve_unittest.cc')
-rw-r--r-- | cc/keyframed_animation_curve_unittest.cc | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/cc/keyframed_animation_curve_unittest.cc b/cc/keyframed_animation_curve_unittest.cc index 0a0efdd..b520dca4 100644 --- a/cc/keyframed_animation_curve_unittest.cc +++ b/cc/keyframed_animation_curve_unittest.cc @@ -4,6 +4,7 @@ #include "cc/keyframed_animation_curve.h" +#include "cc/transform_operations.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebTransformOperations.h" @@ -87,8 +88,13 @@ TEST(KeyframedAnimationCurveTest, RepeatedFloatKeyTimes) TEST(KeyframedAnimationCurveTest, OneTransformKeyframe) { scoped_ptr<KeyframedTransformAnimationCurve> curve(KeyframedTransformAnimationCurve::create()); +#if WEB_TRANSFORM_OPERATIONS_IS_VIRTUAL + TransformOperations operations; + operations.AppendTranslate(2, 0, 0); +#else WebKit::WebTransformOperations operations; operations.appendTranslate(2, 0, 0); +#endif curve->addKeyframe(TransformKeyframe::create(0, operations, scoped_ptr<TimingFunction>())); expectTranslateX(2, curve->getValue(-1)); @@ -102,10 +108,17 @@ TEST(KeyframedAnimationCurveTest, OneTransformKeyframe) TEST(KeyframedAnimationCurveTest, TwoTransformKeyframe) { scoped_ptr<KeyframedTransformAnimationCurve> curve(KeyframedTransformAnimationCurve::create()); +#if WEB_TRANSFORM_OPERATIONS_IS_VIRTUAL + TransformOperations operations1; + operations1.AppendTranslate(2, 0, 0); + TransformOperations operations2; + operations2.AppendTranslate(4, 0, 0); +#else WebKit::WebTransformOperations operations1; operations1.appendTranslate(2, 0, 0); WebKit::WebTransformOperations operations2; operations2.appendTranslate(4, 0, 0); +#endif curve->addKeyframe(TransformKeyframe::create(0, operations1, scoped_ptr<TimingFunction>())); curve->addKeyframe(TransformKeyframe::create(1, operations2, scoped_ptr<TimingFunction>())); @@ -120,12 +133,21 @@ TEST(KeyframedAnimationCurveTest, TwoTransformKeyframe) TEST(KeyframedAnimationCurveTest, ThreeTransformKeyframe) { scoped_ptr<KeyframedTransformAnimationCurve> curve(KeyframedTransformAnimationCurve::create()); +#if WEB_TRANSFORM_OPERATIONS_IS_VIRTUAL + TransformOperations operations1; + operations1.AppendTranslate(2, 0, 0); + TransformOperations operations2; + operations2.AppendTranslate(4, 0, 0); + TransformOperations operations3; + operations3.AppendTranslate(8, 0, 0); +#else WebKit::WebTransformOperations operations1; operations1.appendTranslate(2, 0, 0); WebKit::WebTransformOperations operations2; operations2.appendTranslate(4, 0, 0); WebKit::WebTransformOperations operations3; operations3.appendTranslate(8, 0, 0); +#endif curve->addKeyframe(TransformKeyframe::create(0, operations1, scoped_ptr<TimingFunction>())); curve->addKeyframe(TransformKeyframe::create(1, operations2, scoped_ptr<TimingFunction>())); curve->addKeyframe(TransformKeyframe::create(2, operations3, scoped_ptr<TimingFunction>())); @@ -143,6 +165,16 @@ TEST(KeyframedAnimationCurveTest, RepeatedTransformKeyTimes) { scoped_ptr<KeyframedTransformAnimationCurve> curve(KeyframedTransformAnimationCurve::create()); // A step function. +#if WEB_TRANSFORM_OPERATIONS_IS_VIRTUAL + TransformOperations operations1; + operations1.AppendTranslate(4, 0, 0); + TransformOperations operations2; + operations2.AppendTranslate(4, 0, 0); + TransformOperations operations3; + operations3.AppendTranslate(6, 0, 0); + TransformOperations operations4; + operations4.AppendTranslate(6, 0, 0); +#else WebKit::WebTransformOperations operations1; operations1.appendTranslate(4, 0, 0); WebKit::WebTransformOperations operations2; @@ -151,6 +183,7 @@ TEST(KeyframedAnimationCurveTest, RepeatedTransformKeyTimes) operations3.appendTranslate(6, 0, 0); WebKit::WebTransformOperations operations4; operations4.appendTranslate(6, 0, 0); +#endif curve->addKeyframe(TransformKeyframe::create(0, operations1, scoped_ptr<TimingFunction>())); curve->addKeyframe(TransformKeyframe::create(1, operations2, scoped_ptr<TimingFunction>())); curve->addKeyframe(TransformKeyframe::create(1, operations3, scoped_ptr<TimingFunction>())); |