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

Unified Diff: third_party/WebKit/Source/platform/animation/CompositorTransformAnimationCurve.h

Issue 1616653002: CC Animation: Move files from cc_blink to Source/platform/animation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Fix copyrights and years. Created 4 years, 10 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
Index: third_party/WebKit/Source/platform/animation/CompositorTransformAnimationCurve.h
diff --git a/third_party/WebKit/Source/platform/animation/CompositorTransformAnimationCurve.h b/third_party/WebKit/Source/platform/animation/CompositorTransformAnimationCurve.h
new file mode 100644
index 0000000000000000000000000000000000000000..9cf9020f68c10e87e9d09a68be94977a02737c37
--- /dev/null
+++ b/third_party/WebKit/Source/platform/animation/CompositorTransformAnimationCurve.h
@@ -0,0 +1,57 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CompositorTransformAnimationCurve_h
+#define CompositorTransformAnimationCurve_h
+
+#include "base/memory/scoped_ptr.h"
+#include "platform/PlatformExport.h"
+#include "platform/animation/CompositorAnimationCurve.h"
+#include "platform/animation/CompositorTransformKeyframe.h"
+#include "wtf/Noncopyable.h"
+
+namespace cc {
+class AnimationCurve;
+class KeyframedTransformAnimationCurve;
+}
+
+namespace blink {
+class CompositorTransformKeyframe;
+}
+
+namespace blink {
+
+// A keyframed transform animation curve.
+class PLATFORM_EXPORT CompositorTransformAnimationCurve : public CompositorAnimationCurve {
+ WTF_MAKE_NONCOPYABLE(CompositorTransformAnimationCurve);
+public:
+ CompositorTransformAnimationCurve();
+ ~CompositorTransformAnimationCurve() override;
+
+ // Adds the keyframe with the default timing function (ease).
+ virtual void add(const CompositorTransformKeyframe&);
+ virtual void add(const CompositorTransformKeyframe&, TimingFunctionType);
+ // Adds the keyframe with a custom, bezier timing function. Note, it is
+ // assumed that x0 = y0, and x3 = y3 = 1.
+ virtual void add(const CompositorTransformKeyframe&, double x1, double y1, double x2, double y2);
+ // Adds the keyframe with a steps timing function.
+ virtual void add(const CompositorTransformKeyframe&, int steps, float stepsStartOffset);
+
+ virtual void setLinearTimingFunction();
+ virtual void setCubicBezierTimingFunction(TimingFunctionType);
+ virtual void setCubicBezierTimingFunction(double x1, double y1, double x2, double y2);
+ virtual void setStepsTimingFunction(int numberOfSteps, float stepsStartOffset);
+
+ // CompositorAnimationCurve implementation.
+ AnimationCurveType type() const override;
+
+ scoped_ptr<cc::AnimationCurve> cloneToAnimationCurve() const;
+
+private:
+ scoped_ptr<cc::KeyframedTransformAnimationCurve> m_curve;
+};
+
+} // namespace blink
+
+#endif // CompositorTransformAnimationCurve_h

Powered by Google App Engine
This is Rietveld 408576698