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

Side by Side Diff: sky/engine/core/css/resolver/AnimatedStyleBuilder.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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 16 matching lines...) Expand all
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "sky/engine/core/css/resolver/AnimatedStyleBuilder.h" 31 #include "sky/engine/core/css/resolver/AnimatedStyleBuilder.h"
32 32
33 #include "sky/engine/core/animation/animatable/AnimatableClipPathOperation.h" 33 #include "sky/engine/core/animation/animatable/AnimatableClipPathOperation.h"
34 #include "sky/engine/core/animation/animatable/AnimatableColor.h" 34 #include "sky/engine/core/animation/animatable/AnimatableColor.h"
35 #include "sky/engine/core/animation/animatable/AnimatableDouble.h" 35 #include "sky/engine/core/animation/animatable/AnimatableDouble.h"
36 #include "sky/engine/core/animation/animatable/AnimatableFilterOperations.h" 36 #include "sky/engine/core/animation/animatable/AnimatableFilterOperations.h"
37 #include "sky/engine/core/animation/animatable/AnimatableImage.h"
38 #include "sky/engine/core/animation/animatable/AnimatableLength.h" 37 #include "sky/engine/core/animation/animatable/AnimatableLength.h"
39 #include "sky/engine/core/animation/animatable/AnimatableLengthBox.h" 38 #include "sky/engine/core/animation/animatable/AnimatableLengthBox.h"
40 #include "sky/engine/core/animation/animatable/AnimatableLengthBoxAndBool.h" 39 #include "sky/engine/core/animation/animatable/AnimatableLengthBoxAndBool.h"
41 #include "sky/engine/core/animation/animatable/AnimatableLengthPoint.h" 40 #include "sky/engine/core/animation/animatable/AnimatableLengthPoint.h"
42 #include "sky/engine/core/animation/animatable/AnimatableLengthPoint3D.h" 41 #include "sky/engine/core/animation/animatable/AnimatableLengthPoint3D.h"
43 #include "sky/engine/core/animation/animatable/AnimatableLengthSize.h" 42 #include "sky/engine/core/animation/animatable/AnimatableLengthSize.h"
44 #include "sky/engine/core/animation/animatable/AnimatableRepeatable.h" 43 #include "sky/engine/core/animation/animatable/AnimatableRepeatable.h"
45 #include "sky/engine/core/animation/animatable/AnimatableShadow.h" 44 #include "sky/engine/core/animation/animatable/AnimatableShadow.h"
46 #include "sky/engine/core/animation/animatable/AnimatableShapeValue.h" 45 #include "sky/engine/core/animation/animatable/AnimatableShapeValue.h"
47 #include "sky/engine/core/animation/animatable/AnimatableTransform.h" 46 #include "sky/engine/core/animation/animatable/AnimatableTransform.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 const Vector<RefPtr<AnimatableValue> >& values = toAnimatableRepeatable(valu e)->values(); 134 const Vector<RefPtr<AnimatableValue> >& values = toAnimatableRepeatable(valu e)->values();
136 ASSERT(!values.isEmpty()); 135 ASSERT(!values.isEmpty());
137 FillLayer* fillLayer = &fillLayers; 136 FillLayer* fillLayer = &fillLayers;
138 FillLayer* prev = 0; 137 FillLayer* prev = 0;
139 for (size_t i = 0; i < values.size(); ++i) { 138 for (size_t i = 0; i < values.size(); ++i) {
140 if (!fillLayer) 139 if (!fillLayer)
141 fillLayer = prev->ensureNext(); 140 fillLayer = prev->ensureNext();
142 const AnimatableValue* layerValue = values[i].get(); 141 const AnimatableValue* layerValue = values[i].get();
143 switch (property) { 142 switch (property) {
144 case CSSPropertyBackgroundImage: 143 case CSSPropertyBackgroundImage:
145 if (layerValue->isImage()) { 144 fillLayer->setImage(nullptr);
146 fillLayer->setImage(state.styleImage(property, toAnimatableImage (layerValue)->toCSSValue()));
147 } else {
148 ASSERT(toAnimatableUnknown(layerValue)->toCSSValueID() == CSSVal ueNone);
149 fillLayer->setImage(nullptr);
150 }
151 break; 145 break;
152 case CSSPropertyBackgroundPositionX: 146 case CSSPropertyBackgroundPositionX:
153 fillLayer->setXPosition(animatableValueToLength(layerValue, state)); 147 fillLayer->setXPosition(animatableValueToLength(layerValue, state));
154 break; 148 break;
155 case CSSPropertyBackgroundPositionY: 149 case CSSPropertyBackgroundPositionY:
156 fillLayer->setYPosition(animatableValueToLength(layerValue, state)); 150 fillLayer->setYPosition(animatableValueToLength(layerValue, state));
157 break; 151 break;
158 case CSSPropertyBackgroundSize: 152 case CSSPropertyBackgroundSize:
159 case CSSPropertyWebkitBackgroundSize: 153 case CSSPropertyWebkitBackgroundSize:
160 setFillSize(fillLayer, layerValue, state); 154 setFillSize(fillLayer, layerValue, state);
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 case CSSPropertyBorderBottomWidth: 261 case CSSPropertyBorderBottomWidth:
268 style->setBorderBottomWidth(animatableValueRoundClampTo<unsigned>(value) ); 262 style->setBorderBottomWidth(animatableValueRoundClampTo<unsigned>(value) );
269 return; 263 return;
270 case CSSPropertyBorderImageOutset: 264 case CSSPropertyBorderImageOutset:
271 style->setBorderImageOutset(animatableValueToBorderImageLengthBox(value, state)); 265 style->setBorderImageOutset(animatableValueToBorderImageLengthBox(value, state));
272 return; 266 return;
273 case CSSPropertyBorderImageSlice: 267 case CSSPropertyBorderImageSlice:
274 style->setBorderImageSlices(animatableValueToLengthBox(value, state, Val ueRangeNonNegative)); 268 style->setBorderImageSlices(animatableValueToLengthBox(value, state, Val ueRangeNonNegative));
275 return; 269 return;
276 case CSSPropertyBorderImageSource: 270 case CSSPropertyBorderImageSource:
277 style->setBorderImageSource(state.styleImage(property, toAnimatableImage (value)->toCSSValue()));
278 return; 271 return;
279 case CSSPropertyBorderImageWidth: 272 case CSSPropertyBorderImageWidth:
280 style->setBorderImageWidth(animatableValueToBorderImageLengthBox(value, state)); 273 style->setBorderImageWidth(animatableValueToBorderImageLengthBox(value, state));
281 return; 274 return;
282 case CSSPropertyBorderLeftColor: 275 case CSSPropertyBorderLeftColor:
283 style->setBorderLeftColor(toAnimatableColor(value)->color()); 276 style->setBorderLeftColor(toAnimatableColor(value)->color());
284 return; 277 return;
285 case CSSPropertyBorderLeftWidth: 278 case CSSPropertyBorderLeftWidth:
286 style->setBorderLeftWidth(animatableValueRoundClampTo<unsigned>(value)); 279 style->setBorderLeftWidth(animatableValueRoundClampTo<unsigned>(value));
287 return; 280 return;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 return; 460 return;
468 case CSSPropertyZIndex: 461 case CSSPropertyZIndex:
469 style->setZIndex(animatableValueRoundClampTo<unsigned>(value)); 462 style->setZIndex(animatableValueRoundClampTo<unsigned>(value));
470 return; 463 return;
471 default: 464 default:
472 ASSERT_NOT_REACHED(); 465 ASSERT_NOT_REACHED();
473 } 466 }
474 } 467 }
475 468
476 } // namespace blink 469 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/css/parser/CSSPropertyParser.cpp ('k') | sky/engine/core/css/resolver/CSSToStyleMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698