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

Side by Side Diff: Source/core/animation/ListStyleInterpolation.h

Issue 1069313002: Animation: FilterStyleInterpolation for animating filter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: ASSERT isValueList || CSSValueNone Created 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef ListStyleInterpolation_h 5 #ifndef ListStyleInterpolation_h
6 #define ListStyleInterpolation_h 6 #define ListStyleInterpolation_h
7 7
8 #include "core/animation/StyleInterpolation.h" 8 #include "core/animation/StyleInterpolation.h"
9 #include "core/css/CSSPrimitiveValue.h" 9 #include "core/css/CSSPrimitiveValue.h"
10 #include "core/css/CSSValueList.h" 10 #include "core/css/CSSValueList.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 InterpolationRange m_range; 54 InterpolationRange m_range;
55 55
56 Vector<typename InterpolationType::NonInterpolableType> m_nonInterpolableDat a; 56 Vector<typename InterpolationType::NonInterpolableType> m_nonInterpolableDat a;
57 57
58 static PassOwnPtrWillBeRawPtr<InterpolableValue> listToInterpolableValue(con st CSSValue& value, Vector<typename InterpolationType::NonInterpolableType>* non InterpolableData = nullptr) 58 static PassOwnPtrWillBeRawPtr<InterpolableValue> listToInterpolableValue(con st CSSValue& value, Vector<typename InterpolationType::NonInterpolableType>* non InterpolableData = nullptr)
59 { 59 {
60 const CSSValueList& listValue = toCSSValueList(value); 60 const CSSValueList& listValue = toCSSValueList(value);
61 if (nonInterpolableData) 61 if (nonInterpolableData)
62 nonInterpolableData->reserveCapacity(listValue.length()); 62 nonInterpolableData->reserveCapacity(listValue.length());
63 OwnPtrWillBeRawPtr<InterpolableList> result = InterpolableList::create(l istValue.length()); 63 OwnPtrWillBeRawPtr<InterpolableList> result = InterpolableList::create(l istValue.length());
64 typename InterpolationType::NonInterpolableType elementData = true; 64 typename InterpolationType::NonInterpolableType elementData = typename I nterpolationType::NonInterpolableType();
65 for (size_t i = 0; i < listValue.length(); i++) { 65 for (size_t i = 0; i < listValue.length(); i++) {
66 result->set(i, InterpolationType::toInterpolableValue(*listValue.ite m(i), elementData)); 66 result->set(i, InterpolationType::toInterpolableValue(*listValue.ite m(i), elementData));
67 if (nonInterpolableData) 67 if (nonInterpolableData)
68 nonInterpolableData->append(elementData); 68 nonInterpolableData->append(elementData);
69 } 69 }
70 return result.release(); 70 return result.release();
71 } 71 }
72 72
73 static PassRefPtrWillBeRawPtr<CSSValue> interpolableValueToList(Interpolable Value* value, const Vector<typename InterpolationType::NonInterpolableType>& non InterpolableData, InterpolationRange range = RangeAll) 73 static PassRefPtrWillBeRawPtr<CSSValue> interpolableValueToList(Interpolable Value* value, const Vector<typename InterpolationType::NonInterpolableType>& non InterpolableData, InterpolationRange range = RangeAll)
74 { 74 {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 public: 148 public:
149 static PassRefPtrWillBeRawPtr<ListStyleInterpolationImpl<InterpolationType, typename InterpolationType::NonInterpolableType>> maybeCreateFromList(const CSS Value& start, const CSSValue& end, CSSPropertyID id, InterpolationRange range = RangeAll) 149 static PassRefPtrWillBeRawPtr<ListStyleInterpolationImpl<InterpolationType, typename InterpolationType::NonInterpolableType>> maybeCreateFromList(const CSS Value& start, const CSSValue& end, CSSPropertyID id, InterpolationRange range = RangeAll)
150 { 150 {
151 return ListStyleInterpolationImpl<InterpolationType, typename Interpolat ionType::NonInterpolableType>::maybeCreateFromList(start, end, id, range); 151 return ListStyleInterpolationImpl<InterpolationType, typename Interpolat ionType::NonInterpolableType>::maybeCreateFromList(start, end, id, range);
152 } 152 }
153 }; 153 };
154 154
155 } // namespace blink 155 } // namespace blink
156 156
157 #endif // ListStyleInterpolation_h 157 #endif // ListStyleInterpolation_h
OLDNEW
« no previous file with comments | « Source/core/animation/FilterStyleInterpolationTest.cpp ('k') | Source/core/animation/StringKeyframe.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698