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

Side by Side Diff: sky/engine/core/animation/DeferredLegacyStyleInterpolation.cpp

Issue 1214633005: Remove CSS clients of ImageResource (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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 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 "sky/engine/core/animation/DeferredLegacyStyleInterpolation.h" 5 #include "sky/engine/core/animation/DeferredLegacyStyleInterpolation.h"
6 6
7 #include "sky/engine/core/animation/LegacyStyleInterpolation.h" 7 #include "sky/engine/core/animation/LegacyStyleInterpolation.h"
8 #include "sky/engine/core/css/CSSImageValue.h"
9 #include "sky/engine/core/css/CSSPrimitiveValue.h" 8 #include "sky/engine/core/css/CSSPrimitiveValue.h"
10 #include "sky/engine/core/css/CSSShadowValue.h" 9 #include "sky/engine/core/css/CSSShadowValue.h"
11 #include "sky/engine/core/css/CSSValueList.h" 10 #include "sky/engine/core/css/CSSValueList.h"
12 #include "sky/engine/core/css/Pair.h" 11 #include "sky/engine/core/css/Pair.h"
13 #include "sky/engine/core/css/Rect.h" 12 #include "sky/engine/core/css/Rect.h"
14 #include "sky/engine/core/css/resolver/StyleResolver.h" 13 #include "sky/engine/core/css/resolver/StyleResolver.h"
15 #include "sky/engine/core/css/resolver/StyleResolverState.h" 14 #include "sky/engine/core/css/resolver/StyleResolverState.h"
16 15
17 namespace blink { 16 namespace blink {
18 17
(...skipping 10 matching lines...) Expand all
29 bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const C SSValue& value) 28 bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const C SSValue& value)
30 { 29 {
31 switch (value.cssValueType()) { 30 switch (value.cssValueType()) {
32 case CSSValue::CSS_INHERIT: 31 case CSSValue::CSS_INHERIT:
33 return true; 32 return true;
34 case CSSValue::CSS_PRIMITIVE_VALUE: 33 case CSSValue::CSS_PRIMITIVE_VALUE:
35 return interpolationRequiresStyleResolve(toCSSPrimitiveValue(value)); 34 return interpolationRequiresStyleResolve(toCSSPrimitiveValue(value));
36 case CSSValue::CSS_VALUE_LIST: 35 case CSSValue::CSS_VALUE_LIST:
37 return interpolationRequiresStyleResolve(toCSSValueList(value)); 36 return interpolationRequiresStyleResolve(toCSSValueList(value));
38 case CSSValue::CSS_CUSTOM: 37 case CSSValue::CSS_CUSTOM:
39 if (value.isImageValue())
40 return interpolationRequiresStyleResolve(toCSSImageValue(value));
41 if (value.isShadowValue()) 38 if (value.isShadowValue())
42 return interpolationRequiresStyleResolve(toCSSShadowValue(value)); 39 return interpolationRequiresStyleResolve(toCSSShadowValue(value));
43 // FIXME: consider other custom types. 40 // FIXME: consider other custom types.
44 return true; 41 return true;
45 case CSSValue::CSS_INITIAL: 42 case CSSValue::CSS_INITIAL:
46 // FIXME: should not require resolving styles for initial. 43 // FIXME: should not require resolving styles for initial.
47 return true; 44 return true;
48 default: 45 default:
49 ASSERT_NOT_REACHED(); 46 ASSERT_NOT_REACHED();
50 return true; 47 return true;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 || interpolationRequiresStyleResolve(*quad->bottom()) 87 || interpolationRequiresStyleResolve(*quad->bottom())
91 || interpolationRequiresStyleResolve(*quad->left()); 88 || interpolationRequiresStyleResolve(*quad->left());
92 } 89 }
93 90
94 if (primitiveValue.isShape()) 91 if (primitiveValue.isShape())
95 return interpolationRequiresStyleResolve(*primitiveValue.getShapeValue() ); 92 return interpolationRequiresStyleResolve(*primitiveValue.getShapeValue() );
96 93
97 return (primitiveValue.getValueID() != CSSValueNone); 94 return (primitiveValue.getValueID() != CSSValueNone);
98 } 95 }
99 96
100 bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const C SSImageValue& imageValue)
101 {
102 return false;
103 }
104
105 bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const C SSShadowValue& shadowValue) 97 bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const C SSShadowValue& shadowValue)
106 { 98 {
107 return (shadowValue.x && interpolationRequiresStyleResolve(*shadowValue.x)) 99 return (shadowValue.x && interpolationRequiresStyleResolve(*shadowValue.x))
108 || (shadowValue.y && interpolationRequiresStyleResolve(*shadowValue.y)) 100 || (shadowValue.y && interpolationRequiresStyleResolve(*shadowValue.y))
109 || (shadowValue.blur && interpolationRequiresStyleResolve(*shadowValue.b lur)) 101 || (shadowValue.blur && interpolationRequiresStyleResolve(*shadowValue.b lur))
110 || (shadowValue.spread && interpolationRequiresStyleResolve(*shadowValue .spread)) 102 || (shadowValue.spread && interpolationRequiresStyleResolve(*shadowValue .spread))
111 || (shadowValue.style && interpolationRequiresStyleResolve(*shadowValue. style)) 103 || (shadowValue.style && interpolationRequiresStyleResolve(*shadowValue. style))
112 || (shadowValue.color && interpolationRequiresStyleResolve(*shadowValue. color)); 104 || (shadowValue.color && interpolationRequiresStyleResolve(*shadowValue. color));
113 } 105 }
114 106
115 bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const C SSValueList& valueList) 107 bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const C SSValueList& valueList)
116 { 108 {
117 size_t length = valueList.length(); 109 size_t length = valueList.length();
118 for (size_t index = 0; index < length; ++index) { 110 for (size_t index = 0; index < length; ++index) {
119 if (interpolationRequiresStyleResolve(*valueList.item(index))) 111 if (interpolationRequiresStyleResolve(*valueList.item(index)))
120 return true; 112 return true;
121 } 113 }
122 return false; 114 return false;
123 } 115 }
124 116
125 bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const C SSBasicShape& shape) 117 bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const C SSBasicShape& shape)
126 { 118 {
127 // FIXME: Should determine the specific shape, and inspect the members. 119 // FIXME: Should determine the specific shape, and inspect the members.
128 return false; 120 return false;
129 } 121 }
130 122
131 } 123 }
OLDNEW
« no previous file with comments | « sky/engine/core/animation/DeferredLegacyStyleInterpolation.h ('k') | sky/engine/core/animation/animatable/AnimatableImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698