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

Unified Diff: cc/blink/web_float_animation_curve_impl.cc

Issue 814853003: CC: Allow per-curve timing functions to be steps timing functions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0
Patch Set: Rebase Created 5 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/blink/web_float_animation_curve_impl.h ('k') | cc/blink/web_transform_animation_curve_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/blink/web_float_animation_curve_impl.cc
diff --git a/cc/blink/web_float_animation_curve_impl.cc b/cc/blink/web_float_animation_curve_impl.cc
index ca5b5d0446394bda8ff805a3f53a4d080a3c0e21..4340ae8bdabbeed29f9f2ea8d210fd423b5107cf 100644
--- a/cc/blink/web_float_animation_curve_impl.cc
+++ b/cc/blink/web_float_animation_curve_impl.cc
@@ -54,18 +54,30 @@ void WebFloatAnimationCurveImpl::add(const WebFloatKeyframe& keyframe,
cc::StepsTimingFunction::Create(steps, steps_start_offset)));
}
-void WebFloatAnimationCurveImpl::setTimingFunction(TimingFunctionType type) {
+void WebFloatAnimationCurveImpl::setLinearTimingFunction() {
+ curve_->SetTimingFunction(nullptr);
+}
+
+void WebFloatAnimationCurveImpl::setCubicBezierTimingFunction(
+ TimingFunctionType type) {
curve_->SetTimingFunction(CreateTimingFunction(type));
}
-void WebFloatAnimationCurveImpl::setTimingFunction(double x1,
- double y1,
- double x2,
- double y2) {
+void WebFloatAnimationCurveImpl::setCubicBezierTimingFunction(double x1,
+ double y1,
+ double x2,
+ double y2) {
curve_->SetTimingFunction(
cc::CubicBezierTimingFunction::Create(x1, y1, x2, y2).Pass());
}
+void WebFloatAnimationCurveImpl::setStepsTimingFunction(
+ int number_of_steps,
+ float steps_start_offset) {
+ curve_->SetTimingFunction(cc::StepsTimingFunction::Create(
+ number_of_steps, steps_start_offset).Pass());
+}
+
float WebFloatAnimationCurveImpl::getValue(double time) const {
return curve_->GetValue(base::TimeDelta::FromSecondsD(time));
}
« no previous file with comments | « cc/blink/web_float_animation_curve_impl.h ('k') | cc/blink/web_transform_animation_curve_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698