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

Unified Diff: cc/animation/keyframed_animation_curve.h

Issue 2019613002: Blink Compositor Animation: Make Animation and Curve methods non-virtual. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix codereview issues. Add cc::TimingFunction::Type enum. Created 4 years, 7 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 | « no previous file | cc/animation/timing_function.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/keyframed_animation_curve.h
diff --git a/cc/animation/keyframed_animation_curve.h b/cc/animation/keyframed_animation_curve.h
index 6e26875467211a71de469ba355f539b59c0324c8..8f76e422d73154d1d638f362350760221bef8558 100644
--- a/cc/animation/keyframed_animation_curve.h
+++ b/cc/animation/keyframed_animation_curve.h
@@ -153,9 +153,13 @@ class CC_EXPORT KeyframedFloatAnimationCurve : public FloatAnimationCurve {
~KeyframedFloatAnimationCurve() override;
void AddKeyframe(std::unique_ptr<FloatKeyframe> keyframe);
+
void SetTimingFunction(std::unique_ptr<TimingFunction> timing_function) {
timing_function_ = std::move(timing_function);
}
+ TimingFunction* timing_function_for_testing() const {
+ return timing_function_.get();
+ }
// AnimationCurve implementation
base::TimeDelta Duration() const override;
@@ -164,12 +168,15 @@ class CC_EXPORT KeyframedFloatAnimationCurve : public FloatAnimationCurve {
// FloatAnimationCurve implementation
float GetValue(base::TimeDelta t) const override;
+ using Keyframes = std::vector<std::unique_ptr<FloatKeyframe>>;
+ const Keyframes& keyframes_for_testing() const { return keyframes_; }
+
private:
KeyframedFloatAnimationCurve();
// Always sorted in order of increasing time. No two keyframes have the
// same time.
- std::vector<std::unique_ptr<FloatKeyframe>> keyframes_;
+ Keyframes keyframes_;
std::unique_ptr<TimingFunction> timing_function_;
DISALLOW_COPY_AND_ASSIGN(KeyframedFloatAnimationCurve);
« no previous file with comments | « no previous file | cc/animation/timing_function.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698