| OLD | NEW |
| 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 17 matching lines...) Expand all Loading... |
| 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/animation/css/CSSAnimatableValueFactory.h" | 31 #include "sky/engine/core/animation/css/CSSAnimatableValueFactory.h" |
| 32 | 32 |
| 33 #include "gen/sky/core/CSSValueKeywords.h" | 33 #include "gen/sky/core/CSSValueKeywords.h" |
| 34 #include "sky/engine/core/animation/animatable/AnimatableClipPathOperation.h" | 34 #include "sky/engine/core/animation/animatable/AnimatableClipPathOperation.h" |
| 35 #include "sky/engine/core/animation/animatable/AnimatableColor.h" | 35 #include "sky/engine/core/animation/animatable/AnimatableColor.h" |
| 36 #include "sky/engine/core/animation/animatable/AnimatableDouble.h" | 36 #include "sky/engine/core/animation/animatable/AnimatableDouble.h" |
| 37 #include "sky/engine/core/animation/animatable/AnimatableFilterOperations.h" | 37 #include "sky/engine/core/animation/animatable/AnimatableFilterOperations.h" |
| 38 #include "sky/engine/core/animation/animatable/AnimatableImage.h" | |
| 39 #include "sky/engine/core/animation/animatable/AnimatableLength.h" | 38 #include "sky/engine/core/animation/animatable/AnimatableLength.h" |
| 40 #include "sky/engine/core/animation/animatable/AnimatableLengthBox.h" | 39 #include "sky/engine/core/animation/animatable/AnimatableLengthBox.h" |
| 41 #include "sky/engine/core/animation/animatable/AnimatableLengthBoxAndBool.h" | 40 #include "sky/engine/core/animation/animatable/AnimatableLengthBoxAndBool.h" |
| 42 #include "sky/engine/core/animation/animatable/AnimatableLengthPoint.h" | 41 #include "sky/engine/core/animation/animatable/AnimatableLengthPoint.h" |
| 43 #include "sky/engine/core/animation/animatable/AnimatableLengthPoint3D.h" | 42 #include "sky/engine/core/animation/animatable/AnimatableLengthPoint3D.h" |
| 44 #include "sky/engine/core/animation/animatable/AnimatableLengthSize.h" | 43 #include "sky/engine/core/animation/animatable/AnimatableLengthSize.h" |
| 45 #include "sky/engine/core/animation/animatable/AnimatableRepeatable.h" | 44 #include "sky/engine/core/animation/animatable/AnimatableRepeatable.h" |
| 46 #include "sky/engine/core/animation/animatable/AnimatableShadow.h" | 45 #include "sky/engine/core/animation/animatable/AnimatableShadow.h" |
| 47 #include "sky/engine/core/animation/animatable/AnimatableShapeValue.h" | 46 #include "sky/engine/core/animation/animatable/AnimatableShapeValue.h" |
| 48 #include "sky/engine/core/animation/animatable/AnimatableTransform.h" | 47 #include "sky/engine/core/animation/animatable/AnimatableTransform.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 133 |
| 135 inline static PassRefPtr<AnimatableValue> createFromLengthSize(const LengthSize&
lengthSize, const RenderStyle& style) | 134 inline static PassRefPtr<AnimatableValue> createFromLengthSize(const LengthSize&
lengthSize, const RenderStyle& style) |
| 136 { | 135 { |
| 137 return AnimatableLengthSize::create( | 136 return AnimatableLengthSize::create( |
| 138 createFromLength(lengthSize.width(), style), | 137 createFromLength(lengthSize.width(), style), |
| 139 createFromLength(lengthSize.height(), style)); | 138 createFromLength(lengthSize.height(), style)); |
| 140 } | 139 } |
| 141 | 140 |
| 142 inline static PassRefPtr<AnimatableValue> createFromStyleImage(StyleImage* image
) | 141 inline static PassRefPtr<AnimatableValue> createFromStyleImage(StyleImage* image
) |
| 143 { | 142 { |
| 144 if (image) { | |
| 145 if (RefPtr<CSSValue> cssValue = image->cssValue()) | |
| 146 return AnimatableImage::create(cssValue.release()); | |
| 147 } | |
| 148 return AnimatableUnknown::create(CSSValueNone); | 143 return AnimatableUnknown::create(CSSValueNone); |
| 149 } | 144 } |
| 150 | 145 |
| 151 inline static PassRefPtr<AnimatableValue> createFromFillSize(const FillSize& fil
lSize, const RenderStyle& style) | 146 inline static PassRefPtr<AnimatableValue> createFromFillSize(const FillSize& fil
lSize, const RenderStyle& style) |
| 152 { | 147 { |
| 153 switch (fillSize.type) { | 148 switch (fillSize.type) { |
| 154 case SizeLength: | 149 case SizeLength: |
| 155 return createFromLengthSize(fillSize.size, style); | 150 return createFromLengthSize(fillSize.size, style); |
| 156 case Contain: | 151 case Contain: |
| 157 case Cover: | 152 case Cover: |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 case CSSPropertyZIndex: | 404 case CSSPropertyZIndex: |
| 410 return createFromDouble(style.zIndex()); | 405 return createFromDouble(style.zIndex()); |
| 411 default: | 406 default: |
| 412 ASSERT_NOT_REACHED(); | 407 ASSERT_NOT_REACHED(); |
| 413 // This return value is to avoid a release crash if possible. | 408 // This return value is to avoid a release crash if possible. |
| 414 return AnimatableUnknown::create(nullptr); | 409 return AnimatableUnknown::create(nullptr); |
| 415 } | 410 } |
| 416 } | 411 } |
| 417 | 412 |
| 418 } // namespace blink | 413 } // namespace blink |
| OLD | NEW |