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

Unified Diff: cc/blink/web_transform_animation_curve_impl.cc

Issue 809523004: Define step timing function for the cc animation framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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: cc/blink/web_transform_animation_curve_impl.cc
diff --git a/cc/blink/web_transform_animation_curve_impl.cc b/cc/blink/web_transform_animation_curve_impl.cc
index 86f3602cecd560cdb10d4fe709d3a61ae117b697..80c1d1d02faaf9f7f0fae3ee0e10445b7e9c3c34 100644
--- a/cc/blink/web_transform_animation_curve_impl.cc
+++ b/cc/blink/web_transform_animation_curve_impl.cc
@@ -53,6 +53,17 @@ void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe,
cc::CubicBezierTimingFunction::Create(x1, y1, x2, y2)));
}
+void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe,
+ int steps,
+ float steps_start_offset) {
+ const cc::TransformOperations& transform_operations =
+ static_cast<const WebTransformOperationsImpl&>(keyframe.value())
+ .AsTransformOperations();
+ curve_->AddKeyframe(cc::TransformKeyframe::Create(
+ base::TimeDelta::FromSecondsD(keyframe.time()), transform_operations,
+ cc::StepsTimingFunction::Create(steps, steps_start_offset)));
+}
+
void WebTransformAnimationCurveImpl::setTimingFunction(
TimingFunctionType type) {
curve_->SetTimingFunction(CreateTimingFunction(type));
« cc/animation/timing_function.cc ('K') | « cc/blink/web_transform_animation_curve_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698