Index: cc/keyframed_animation_curve.cc |
diff --git a/cc/keyframed_animation_curve.cc b/cc/keyframed_animation_curve.cc |
index ef03357a26a30e96238c0a947a8c32f0787214d2..90f9315fac101726f32b5c56623cbd275746267e 100644 |
--- a/cc/keyframed_animation_curve.cc |
+++ b/cc/keyframed_animation_curve.cc |
@@ -84,6 +84,18 @@ scoped_ptr<FloatKeyframe> FloatKeyframe::clone() const |
return FloatKeyframe::create(time(), value(), func.Pass()); |
} |
+#if WEB_TRANSFORM_OPERATIONS_IS_VIRTUAL |
+scoped_ptr<TransformKeyframe> TransformKeyframe::create(double time, const TransformOperations& value, scoped_ptr<TimingFunction> timingFunction) |
+{ |
+ return make_scoped_ptr(new TransformKeyframe(time, value, timingFunction.Pass())); |
+} |
+ |
+TransformKeyframe::TransformKeyframe(double time, const TransformOperations& value, scoped_ptr<TimingFunction> timingFunction) |
+ : Keyframe(time, timingFunction.Pass()) |
+ , m_value(value) |
+{ |
+} |
+#else |
scoped_ptr<TransformKeyframe> TransformKeyframe::create(double time, const WebKit::WebTransformOperations& value, scoped_ptr<TimingFunction> timingFunction) |
{ |
return make_scoped_ptr(new TransformKeyframe(time, value, timingFunction.Pass())); |
@@ -94,15 +106,23 @@ TransformKeyframe::TransformKeyframe(double time, const WebKit::WebTransformOper |
, m_value(value) |
{ |
} |
+#endif |
TransformKeyframe::~TransformKeyframe() |
{ |
} |
+#if WEB_TRANSFORM_OPERATIONS_IS_VIRTUAL |
+const TransformOperations& TransformKeyframe::value() const |
+{ |
+ return m_value; |
+} |
+#else |
const WebKit::WebTransformOperations& TransformKeyframe::value() const |
{ |
return m_value; |
} |
+#endif |
scoped_ptr<TransformKeyframe> TransformKeyframe::clone() const |
{ |
@@ -198,12 +218,21 @@ scoped_ptr<AnimationCurve> KeyframedTransformAnimationCurve::clone() const |
WebTransformationMatrix KeyframedTransformAnimationCurve::getValue(double t) const |
{ |
+#if WEB_TRANSFORM_OPERATIONS_IS_VIRTUAL |
+ if (t <= m_keyframes.front()->time()) |
+ return m_keyframes.front()->value().Apply(); |
+ |
+ if (t >= m_keyframes.back()->time()) |
+ return m_keyframes.back()->value().Apply(); |
+#else |
if (t <= m_keyframes.front()->time()) |
return m_keyframes.front()->value().apply(); |
if (t >= m_keyframes.back()->time()) |
return m_keyframes.back()->value().apply(); |
+#endif |
+ |
size_t i = 0; |
for (; i < m_keyframes.size() - 1; ++i) { |
if (t < m_keyframes[i+1]->time()) |
@@ -215,7 +244,11 @@ WebTransformationMatrix KeyframedTransformAnimationCurve::getValue(double t) con |
if (m_keyframes[i]->timingFunction()) |
progress = m_keyframes[i]->timingFunction()->getValue(progress); |
+#if WEB_TRANSFORM_OPERATIONS_IS_VIRTUAL |
+ return m_keyframes[i+1]->value().Blend(m_keyframes[i]->value(), progress); |
+#else |
return m_keyframes[i+1]->value().blend(m_keyframes[i]->value(), progress); |
+#endif |
} |
} // namespace cc |