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

Unified Diff: Source/core/animation/AnimatableDouble.h

Issue 25082007: Web Animations CSS: Split AnimatableNumber into AnimatableDouble and AnimatableLength (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review changes Created 7 years, 2 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 | Source/core/animation/AnimatableDouble.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/AnimatableDouble.h
diff --git a/Source/core/animation/AnimatableTransform.h b/Source/core/animation/AnimatableDouble.h
similarity index 69%
copy from Source/core/animation/AnimatableTransform.h
copy to Source/core/animation/AnimatableDouble.h
index cececfe45afd3344a927cf50373e5f25becb258b..ed10de4b11478d308f4a20ee62d1c8259f3391a3 100644
--- a/Source/core/animation/AnimatableTransform.h
+++ b/Source/core/animation/AnimatableDouble.h
@@ -28,43 +28,46 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef AnimatableTransform_h
-#define AnimatableTransform_h
+#ifndef AnimatableDouble_h
+#define AnimatableDouble_h
#include "core/animation/AnimatableValue.h"
-#include "core/platform/graphics/transforms/TransformOperations.h"
+#include "core/css/CSSValue.h"
namespace WebCore {
-class AnimatableTransform : public AnimatableValue {
+class AnimatableDouble : public AnimatableValue {
public:
- virtual ~AnimatableTransform() { }
- static PassRefPtr<AnimatableTransform> create(const TransformOperations&);
- const TransformOperations& transformOperations() const
+ virtual ~AnimatableDouble() { }
+
+ static PassRefPtr<AnimatableDouble> create(double number)
{
- return m_transform;
+ return adoptRef(new AnimatableDouble(number));
}
+ PassRefPtr<CSSValue> toCSSValue() const;
+ double toDouble() const { return m_number; }
+
protected:
virtual PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const OVERRIDE;
virtual PassRefPtr<AnimatableValue> addWith(const AnimatableValue*) const OVERRIDE;
private:
- explicit AnimatableTransform(const TransformOperations& transform)
- : m_transform(transform)
+ AnimatableDouble(double number)
+ : m_number(number)
{
}
- virtual AnimatableType type() const OVERRIDE { return TypeTransform; }
- const TransformOperations m_transform;
+ virtual AnimatableType type() const OVERRIDE { return TypeDouble; }
+
+ double m_number;
};
-inline const AnimatableTransform* toAnimatableTransform(const AnimatableValue* value)
+inline const AnimatableDouble* toAnimatableDouble(const AnimatableValue* value)
{
- ASSERT_WITH_SECURITY_IMPLICATION(value && value->isTransform());
- return static_cast<const AnimatableTransform*>(value);
+ ASSERT_WITH_SECURITY_IMPLICATION(value && value->isDouble());
+ return static_cast<const AnimatableDouble*>(value);
}
} // namespace WebCore
-#endif // AnimatableTransform_h
-
+#endif // AnimatableDouble_h
« no previous file with comments | « no previous file | Source/core/animation/AnimatableDouble.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698