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

Side by Side 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: Add missing test file 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/animation/Interpolation.h ('k') | Source/core/animation/InterpolationTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/animation/Interpolation.h" 6 #include "core/animation/Interpolation.h"
7 7
8 #include "core/css/CSSCalculationValue.h" 8 #include "core/css/CSSCalculationValue.h"
9 #include "core/css/resolver/AnimatedStyleBuilder.h" 9 #include "core/css/CSSPrimitiveValue.h"
10 #include "core/css/resolver/StyleBuilder.h" 10 #include "core/css/resolver/StyleBuilder.h"
11 #include "core/css/resolver/StyleResolverState.h"
12 11
13 namespace WebCore { 12 namespace WebCore {
14 13
15 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(Interpolation); 14 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(Interpolation);
16 15
17 namespace { 16 namespace {
18 17
19 bool typesMatch(const InterpolableValue* start, const InterpolableValue* end) 18 bool typesMatch(const InterpolableValue* start, const InterpolableValue* end)
20 { 19 {
21 if (start->isNumber()) 20 if (start->isNumber())
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 visitor->trace(m_start); 62 visitor->trace(m_start);
64 visitor->trace(m_end); 63 visitor->trace(m_end);
65 visitor->trace(m_cachedValue); 64 visitor->trace(m_cachedValue);
66 } 65 }
67 66
68 void StyleInterpolation::trace(Visitor* visitor) 67 void StyleInterpolation::trace(Visitor* visitor)
69 { 68 {
70 Interpolation::trace(visitor); 69 Interpolation::trace(visitor);
71 } 70 }
72 71
73 void LegacyStyleInterpolation::apply(StyleResolverState& state) const
74 {
75 AnimatedStyleBuilder::applyProperty(m_id, state, currentValue().get());
76 }
77
78 void LegacyStyleInterpolation::trace(Visitor* visitor)
79 {
80 StyleInterpolation::trace(visitor);
81 }
82
83 bool LengthStyleInterpolation::canCreateFrom(const CSSValue& value) 72 bool LengthStyleInterpolation::canCreateFrom(const CSSValue& value)
84 { 73 {
85 if (value.isPrimitiveValue()) { 74 if (value.isPrimitiveValue()) {
86 const CSSPrimitiveValue& primitiveValue = WebCore::toCSSPrimitiveValue(v alue); 75 const CSSPrimitiveValue& primitiveValue = WebCore::toCSSPrimitiveValue(v alue);
87 if (primitiveValue.cssCalcValue()) 76 if (primitiveValue.cssCalcValue())
88 return true; 77 return true;
89 78
90 CSSPrimitiveValue::LengthUnitType type; 79 CSSPrimitiveValue::LengthUnitType type;
91 // Only returns true if the type is a primitive length unit. 80 // Only returns true if the type is a primitive length unit.
92 return CSSPrimitiveValue::unitTypeToLengthUnitType(primitiveValue.primit iveType(), type); 81 return CSSPrimitiveValue::unitTypeToLengthUnitType(primitiveValue.primit iveType(), type);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 } 167 }
179 168
180 void DefaultStyleInterpolation::trace(Visitor* visitor) 169 void DefaultStyleInterpolation::trace(Visitor* visitor)
181 { 170 {
182 StyleInterpolation::trace(visitor); 171 StyleInterpolation::trace(visitor);
183 visitor->trace(m_startCSSValue); 172 visitor->trace(m_startCSSValue);
184 visitor->trace(m_endCSSValue); 173 visitor->trace(m_endCSSValue);
185 } 174 }
186 175
187 } 176 }
OLDNEW
« no previous file with comments | « Source/core/animation/Interpolation.h ('k') | Source/core/animation/InterpolationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698