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

Unified Diff: Source/core/animation/Interpolation.cpp

Issue 273683005: Web Animations API: Deferred computation of interpolated values (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix crashing shadow animation tests Created 6 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
Index: Source/core/animation/Interpolation.cpp
diff --git a/Source/core/animation/Interpolation.cpp b/Source/core/animation/Interpolation.cpp
index 1738b817f533f9a98d670160a2a91f1ae70aaa9c..4b67a64ffa09f23c57802137dbd63ab180beaaf2 100644
--- a/Source/core/animation/Interpolation.cpp
+++ b/Source/core/animation/Interpolation.cpp
@@ -6,9 +6,8 @@
#include "core/animation/Interpolation.h"
#include "core/css/CSSCalculationValue.h"
-#include "core/css/resolver/AnimatedStyleBuilder.h"
+#include "core/css/CSSPrimitiveValue.h"
#include "core/css/resolver/StyleBuilder.h"
-#include "core/css/resolver/StyleResolverState.h"
namespace WebCore {
@@ -44,15 +43,18 @@ Interpolation::Interpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, Pa
, m_end(end)
, m_cachedFraction(0)
, m_cachedIteration(0)
- , m_cachedValue(m_start->clone())
{
- RELEASE_ASSERT(typesMatch(m_start.get(), m_end.get()));
+ if (m_start) {
+ m_cachedValue = m_start->clone();
+ RELEASE_ASSERT(typesMatch(m_start.get(), m_end.get()));
+ }
}
void Interpolation::interpolate(int iteration, double fraction) const
{
if (m_cachedFraction != fraction || m_cachedIteration != iteration) {
- m_cachedValue = m_start->interpolate(*m_end, fraction);
+ if (m_start)
+ m_cachedValue = m_start->interpolate(*m_end, fraction);
m_cachedIteration = iteration;
m_cachedFraction = fraction;
}
@@ -70,16 +72,6 @@ void StyleInterpolation::trace(Visitor* visitor)
Interpolation::trace(visitor);
}
-void LegacyStyleInterpolation::apply(StyleResolverState& state) const
-{
- AnimatedStyleBuilder::applyProperty(m_id, state, currentValue().get());
-}
-
-void LegacyStyleInterpolation::trace(Visitor* visitor)
-{
- StyleInterpolation::trace(visitor);
-}
-
bool LengthStyleInterpolation::canCreateFrom(const CSSValue& value)
{
if (value.isPrimitiveValue()) {

Powered by Google App Engine
This is Rietveld 408576698