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

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

Issue 982913003: Web Animations: Add a fast path for LengthStyleIntepolation application (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make compile work. Created 5 years, 9 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/LengthStyleInterpolation.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/LengthStyleInterpolation.h
diff --git a/Source/core/animation/LengthStyleInterpolation.h b/Source/core/animation/LengthStyleInterpolation.h
index 7f6d34efa47de8977a4b1694d1c2b286117d952d..ff91fd0efd391de93a6cd983cdd56dc2b9ced8ea 100644
--- a/Source/core/animation/LengthStyleInterpolation.h
+++ b/Source/core/animation/LengthStyleInterpolation.h
@@ -7,13 +7,15 @@
#include "core/animation/StyleInterpolation.h"
#include "core/css/CSSPrimitiveValue.h"
-#include "platform/Length.h"
namespace blink {
+class LayoutStyle;
+class Length;
+
class LengthStyleInterpolation : public StyleInterpolation {
public:
-
+ typedef void (LayoutStyle::*LengthSetter)(const Length&);
typedef void NonInterpolableType;
static PassRefPtrWillBeRawPtr<LengthStyleInterpolation> create(const CSSValue& start, const CSSValue& end, CSSPropertyID id, InterpolationRange range)
@@ -31,12 +33,20 @@ public:
static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> fromInterpolableValue(const InterpolableValue&, InterpolationRange);
private:
- LengthStyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, PassOwnPtrWillBeRawPtr<InterpolableValue> end, CSSPropertyID id, InterpolationRange range)
+ LengthStyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, PassOwnPtrWillBeRawPtr<InterpolableValue> end, CSSPropertyID id, InterpolationRange range)
: StyleInterpolation(start, end, id)
, m_range(range)
- { }
+ , m_lengthSetter(nullptr)
+ {
+ if (isPixelsOrPercentOnly(*m_start) && isPixelsOrPercentOnly(*m_end))
+ m_lengthSetter = lengthSetterForProperty(id);
+ }
+
+ static bool isPixelsOrPercentOnly(const InterpolableValue&);
+ static LengthSetter lengthSetterForProperty(CSSPropertyID);
InterpolationRange m_range;
+ LengthSetter m_lengthSetter;
};
}
« no previous file with comments | « no previous file | Source/core/animation/LengthStyleInterpolation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698