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

Unified Diff: cc/test/animation_test_common.cc

Issue 11876016: Define cc::TransformOperations and webkit::WebTransformOperationsImpl (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Put TransformOperation into its own header Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/keyframed_animation_curve_unittest.cc ('k') | cc/transform_operation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/animation_test_common.cc
diff --git a/cc/test/animation_test_common.cc b/cc/test/animation_test_common.cc
index 6b896b6644820544a143a1a4008965970455d87b..13af91d6a75bd326bfad7a83e325c54e3b0bb149 100644
--- a/cc/test/animation_test_common.cc
+++ b/cc/test/animation_test_common.cc
@@ -8,6 +8,7 @@
#include "cc/layer.h"
#include "cc/layer_animation_controller.h"
#include "cc/layer_impl.h"
+#include "cc/transform_operations.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebTransformOperations.h"
using cc::Animation;
@@ -49,6 +50,16 @@ int addAnimatedTransform(Target& target, double duration, int deltaX, int deltaY
{
scoped_ptr<KeyframedTransformAnimationCurve> curve(KeyframedTransformAnimationCurve::create());
+#if WEB_TRANSFORM_OPERATIONS_IS_VIRTUAL
+ if (duration > 0) {
+ TransformOperations startOperations;
+ startOperations.AppendTranslate(deltaX, deltaY, 0);
+ curve->addKeyframe(TransformKeyframe::create(0, startOperations, scoped_ptr<cc::TimingFunction>()));
+ }
+
+ TransformOperations operations;
+ operations.AppendTranslate(deltaX, deltaY, 0);
+#else
if (duration > 0) {
WebKit::WebTransformOperations startOperations;
startOperations.appendTranslate(deltaX, deltaY, 0);
@@ -57,6 +68,7 @@ int addAnimatedTransform(Target& target, double duration, int deltaX, int deltaY
WebKit::WebTransformOperations operations;
operations.appendTranslate(deltaX, deltaY, 0);
+#endif
curve->addKeyframe(TransformKeyframe::create(duration, operations, scoped_ptr<cc::TimingFunction>()));
int id = nextAnimationId++;
« no previous file with comments | « cc/keyframed_animation_curve_unittest.cc ('k') | cc/transform_operation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698