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

Side by Side Diff: sky/engine/core/animation/css/CSSAnimatableValueFactory.cpp

Issue 703563002: Remove shape-outside. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } 206 }
207 return AnimatableRepeatable::create(values); 207 return AnimatableRepeatable::create(values);
208 } 208 }
209 209
210 PassRefPtr<AnimatableValue> CSSAnimatableValueFactory::createFromColor(CSSProper tyID property, const RenderStyle& style) 210 PassRefPtr<AnimatableValue> CSSAnimatableValueFactory::createFromColor(CSSProper tyID property, const RenderStyle& style)
211 { 211 {
212 Color color = style.colorIncludingFallback(property); 212 Color color = style.colorIncludingFallback(property);
213 return AnimatableColor::create(color); 213 return AnimatableColor::create(color);
214 } 214 }
215 215
216 inline static PassRefPtr<AnimatableValue> createFromShapeValue(ShapeValue* value )
217 {
218 if (value)
219 return AnimatableShapeValue::create(value);
220 return AnimatableUnknown::create(CSSValueNone);
221 }
222
223 static double fontStretchToDouble(FontStretch fontStretch) 216 static double fontStretchToDouble(FontStretch fontStretch)
224 { 217 {
225 return static_cast<unsigned>(fontStretch); 218 return static_cast<unsigned>(fontStretch);
226 } 219 }
227 220
228 static PassRefPtr<AnimatableValue> createFromFontStretch(FontStretch fontStretch ) 221 static PassRefPtr<AnimatableValue> createFromFontStretch(FontStretch fontStretch )
229 { 222 {
230 return createFromDouble(fontStretchToDouble(fontStretch)); 223 return createFromDouble(fontStretchToDouble(fontStretch));
231 } 224 }
232 225
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 case CSSPropertyWebkitMaskPositionY: 411 case CSSPropertyWebkitMaskPositionY:
419 return createFromFillLayers<CSSPropertyWebkitMaskPositionY>(style.maskLa yers(), style); 412 return createFromFillLayers<CSSPropertyWebkitMaskPositionY>(style.maskLa yers(), style);
420 case CSSPropertyWebkitMaskSize: 413 case CSSPropertyWebkitMaskSize:
421 return createFromFillLayers<CSSPropertyWebkitMaskSize>(style.maskLayers( ), style); 414 return createFromFillLayers<CSSPropertyWebkitMaskSize>(style.maskLayers( ), style);
422 case CSSPropertyPerspective: 415 case CSSPropertyPerspective:
423 return createFromDouble(style.perspective()); 416 return createFromDouble(style.perspective());
424 case CSSPropertyPerspectiveOrigin: 417 case CSSPropertyPerspectiveOrigin:
425 return AnimatableLengthPoint::create( 418 return AnimatableLengthPoint::create(
426 createFromLength(style.perspectiveOriginX(), style), 419 createFromLength(style.perspectiveOriginX(), style),
427 createFromLength(style.perspectiveOriginY(), style)); 420 createFromLength(style.perspectiveOriginY(), style));
428 case CSSPropertyShapeOutside:
429 return createFromShapeValue(style.shapeOutside());
430 case CSSPropertyShapeMargin:
431 return createFromLength(style.shapeMargin(), style);
432 case CSSPropertyShapeImageThreshold:
433 return createFromDouble(style.shapeImageThreshold());
434 case CSSPropertyWebkitTextStrokeColor: 421 case CSSPropertyWebkitTextStrokeColor:
435 return createFromColor(property, style); 422 return createFromColor(property, style);
436 case CSSPropertyTransform: 423 case CSSPropertyTransform:
437 return AnimatableTransform::create(style.transform()); 424 return AnimatableTransform::create(style.transform());
438 case CSSPropertyTransformOrigin: 425 case CSSPropertyTransformOrigin:
439 return AnimatableLengthPoint3D::create( 426 return AnimatableLengthPoint3D::create(
440 createFromLength(style.transformOriginX(), style), 427 createFromLength(style.transformOriginX(), style),
441 createFromLength(style.transformOriginY(), style), 428 createFromLength(style.transformOriginY(), style),
442 createFromDouble(style.transformOriginZ())); 429 createFromDouble(style.transformOriginZ()));
443 case CSSPropertyWidows: 430 case CSSPropertyWidows:
(...skipping 11 matching lines...) Expand all
455 case CSSPropertyZoom: 442 case CSSPropertyZoom:
456 return createFromDouble(style.zoom()); 443 return createFromDouble(style.zoom());
457 default: 444 default:
458 ASSERT_NOT_REACHED(); 445 ASSERT_NOT_REACHED();
459 // This return value is to avoid a release crash if possible. 446 // This return value is to avoid a release crash if possible.
460 return AnimatableUnknown::create(nullptr); 447 return AnimatableUnknown::create(nullptr);
461 } 448 }
462 } 449 }
463 450
464 } // namespace blink 451 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/animation/StringKeyframe.cpp ('k') | sky/engine/core/animation/css/CSSPropertyEquality.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698