summaryrefslogtreecommitdiffstats
path: root/cc/blink
diff options
context:
space:
mode:
authorikilpatrick <ikilpatrick@chromium.org>2014-09-29 00:07:31 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-29 07:08:49 +0000
commitab5e169ebadefcbe3455cbcf5731379e8ef97670 (patch)
tree793828eb3c71eabcd61e08e339318b786152fdf7 /cc/blink
parent51efcddedeeac9d150bc8a199ae20c83b6f0de61 (diff)
downloadchromium_src-ab5e169ebadefcbe3455cbcf5731379e8ef97670.zip
chromium_src-ab5e169ebadefcbe3455cbcf5731379e8ef97670.tar.gz
chromium_src-ab5e169ebadefcbe3455cbcf5731379e8ef97670.tar.bz2
CC: Add curve (whole animation) timing function to compositor animations.
For adding web animations with animation timing on compositor. BUG=417909 Review URL: https://codereview.chromium.org/598853003 Cr-Commit-Position: refs/heads/master@{#297147}
Diffstat (limited to 'cc/blink')
-rw-r--r--cc/blink/web_filter_animation_curve_impl.cc12
-rw-r--r--cc/blink/web_filter_animation_curve_impl.h2
-rw-r--r--cc/blink/web_float_animation_curve_impl.cc12
-rw-r--r--cc/blink/web_float_animation_curve_impl.h2
-rw-r--r--cc/blink/web_transform_animation_curve_impl.cc13
-rw-r--r--cc/blink/web_transform_animation_curve_impl.h2
6 files changed, 43 insertions, 0 deletions
diff --git a/cc/blink/web_filter_animation_curve_impl.cc b/cc/blink/web_filter_animation_curve_impl.cc
index 3761a51..606929e 100644
--- a/cc/blink/web_filter_animation_curve_impl.cc
+++ b/cc/blink/web_filter_animation_curve_impl.cc
@@ -49,6 +49,18 @@ void WebFilterAnimationCurveImpl::add(const WebFilterKeyframe& keyframe,
cc::CubicBezierTimingFunction::Create(x1, y1, x2, y2)));
}
+void WebFilterAnimationCurveImpl::setTimingFunction(TimingFunctionType type) {
+ curve_->SetTimingFunction(CreateTimingFunction(type));
+}
+
+void WebFilterAnimationCurveImpl::setTimingFunction(double x1,
+ double y1,
+ double x2,
+ double y2) {
+ curve_->SetTimingFunction(
+ cc::CubicBezierTimingFunction::Create(x1, y1, x2, y2).Pass());
+}
+
scoped_ptr<cc::AnimationCurve>
WebFilterAnimationCurveImpl::CloneToAnimationCurve() const {
return curve_->Clone();
diff --git a/cc/blink/web_filter_animation_curve_impl.h b/cc/blink/web_filter_animation_curve_impl.h
index 0454cce..ea75eb5 100644
--- a/cc/blink/web_filter_animation_curve_impl.h
+++ b/cc/blink/web_filter_animation_curve_impl.h
@@ -36,6 +36,8 @@ class WebFilterAnimationCurveImpl : public blink::WebFilterAnimationCurve {
double y1,
double x2,
double y2);
+ virtual void setTimingFunction(TimingFunctionType type);
+ virtual void setTimingFunction(double x1, double y1, double x2, double y2);
scoped_ptr<cc::AnimationCurve> CloneToAnimationCurve() const;
diff --git a/cc/blink/web_float_animation_curve_impl.cc b/cc/blink/web_float_animation_curve_impl.cc
index 243d133..e5eee53 100644
--- a/cc/blink/web_float_animation_curve_impl.cc
+++ b/cc/blink/web_float_animation_curve_impl.cc
@@ -46,6 +46,18 @@ void WebFloatAnimationCurveImpl::add(const WebFloatKeyframe& keyframe,
cc::CubicBezierTimingFunction::Create(x1, y1, x2, y2)));
}
+void WebFloatAnimationCurveImpl::setTimingFunction(TimingFunctionType type) {
+ curve_->SetTimingFunction(CreateTimingFunction(type));
+}
+
+void WebFloatAnimationCurveImpl::setTimingFunction(double x1,
+ double y1,
+ double x2,
+ double y2) {
+ curve_->SetTimingFunction(
+ cc::CubicBezierTimingFunction::Create(x1, y1, x2, y2).Pass());
+}
+
float WebFloatAnimationCurveImpl::getValue(double time) const {
return curve_->GetValue(time);
}
diff --git a/cc/blink/web_float_animation_curve_impl.h b/cc/blink/web_float_animation_curve_impl.h
index 09cadb8..8e5ccd2 100644
--- a/cc/blink/web_float_animation_curve_impl.h
+++ b/cc/blink/web_float_animation_curve_impl.h
@@ -37,6 +37,8 @@ class WebFloatAnimationCurveImpl : public blink::WebFloatAnimationCurve {
double y1,
double x2,
double y2);
+ virtual void setTimingFunction(TimingFunctionType type);
+ virtual void setTimingFunction(double x1, double y1, double x2, double y2);
virtual float getValue(double time) const;
diff --git a/cc/blink/web_transform_animation_curve_impl.cc b/cc/blink/web_transform_animation_curve_impl.cc
index 3b2313f..f91d94b 100644
--- a/cc/blink/web_transform_animation_curve_impl.cc
+++ b/cc/blink/web_transform_animation_curve_impl.cc
@@ -53,6 +53,19 @@ void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe,
cc::CubicBezierTimingFunction::Create(x1, y1, x2, y2)));
}
+void WebTransformAnimationCurveImpl::setTimingFunction(
+ TimingFunctionType type) {
+ curve_->SetTimingFunction(CreateTimingFunction(type));
+}
+
+void WebTransformAnimationCurveImpl::setTimingFunction(double x1,
+ double y1,
+ double x2,
+ double y2) {
+ curve_->SetTimingFunction(
+ cc::CubicBezierTimingFunction::Create(x1, y1, x2, y2).Pass());
+}
+
scoped_ptr<cc::AnimationCurve>
WebTransformAnimationCurveImpl::CloneToAnimationCurve() const {
return curve_->Clone();
diff --git a/cc/blink/web_transform_animation_curve_impl.h b/cc/blink/web_transform_animation_curve_impl.h
index 95ca902..a4dbe22 100644
--- a/cc/blink/web_transform_animation_curve_impl.h
+++ b/cc/blink/web_transform_animation_curve_impl.h
@@ -38,6 +38,8 @@ class WebTransformAnimationCurveImpl
double y1,
double x2,
double y2);
+ virtual void setTimingFunction(TimingFunctionType type);
+ virtual void setTimingFunction(double x1, double y1, double x2, double y2);
scoped_ptr<cc::AnimationCurve> CloneToAnimationCurve() const;