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

Unified Diff: webkit/compositor_bindings/web_transform_animation_curve_impl.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
Index: webkit/compositor_bindings/web_transform_animation_curve_impl.cc
diff --git a/webkit/compositor_bindings/web_transform_animation_curve_impl.cc b/webkit/compositor_bindings/web_transform_animation_curve_impl.cc
index 3117d0a969cba652e38ca6fbc7b326e68591806a..6525c2364df863df9e4e0b57c4871b69fc48e8f7 100644
--- a/webkit/compositor_bindings/web_transform_animation_curve_impl.cc
+++ b/webkit/compositor_bindings/web_transform_animation_curve_impl.cc
@@ -6,7 +6,9 @@
#include "cc/keyframed_animation_curve.h"
#include "cc/timing_function.h"
+#include "cc/transform_operations.h"
#include "webkit/compositor_bindings/web_animation_curve_common.h"
+#include "webkit/compositor_bindings/web_transform_operations_impl.h"
namespace WebKit {
@@ -31,12 +33,24 @@ void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe)
void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe, TimingFunctionType type)
{
+#if WEB_TRANSFORM_OPERATIONS_IS_VIRTUAL
+ const cc::TransformOperations& transformOperations =
+ static_cast<const webkit::WebTransformOperationsImpl&>(keyframe.value()).AsTransformOperations();
+ m_curve->addKeyframe(cc::TransformKeyframe::create(keyframe.time(), transformOperations, createTimingFunction(type)));
+#else
m_curve->addKeyframe(cc::TransformKeyframe::create(keyframe.time, keyframe.value, createTimingFunction(type)));
+#endif
}
void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe, double x1, double y1, double x2, double y2)
{
+#if WEB_TRANSFORM_OPERATIONS_IS_VIRTUAL
+ const cc::TransformOperations& transformOperations =
+ static_cast<const webkit::WebTransformOperationsImpl&>(keyframe.value()).AsTransformOperations();
+ m_curve->addKeyframe(cc::TransformKeyframe::create(keyframe.time(), transformOperations, cc::CubicBezierTimingFunction::create(x1, y1, x2, y2).PassAs<cc::TimingFunction>()));
+#else
m_curve->addKeyframe(cc::TransformKeyframe::create(keyframe.time, keyframe.value, cc::CubicBezierTimingFunction::create(x1, y1, x2, y2).PassAs<cc::TimingFunction>()));
+#endif
}
WebTransformationMatrix WebTransformAnimationCurveImpl::getValue(double time) const

Powered by Google App Engine
This is Rietveld 408576698