| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/animation/FilterInterpolationFunctions.h" | 5 #include "core/animation/FilterInterpolationFunctions.h" |
| 6 | 6 |
| 7 #include "core/animation/CSSLengthInterpolationType.h" | 7 #include "core/animation/CSSLengthInterpolationType.h" |
| 8 #include "core/animation/ShadowInterpolationFunctions.h" | 8 #include "core/animation/ShadowInterpolationFunctions.h" |
| 9 #include "core/css/CSSFunctionValue.h" | 9 #include "core/css/CSSFunctionValue.h" |
| 10 #include "core/css/CSSPrimitiveValue.h" | 10 #include "core/css/CSSPrimitiveValue.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 default: | 84 default: |
| 85 NOTREACHED(); | 85 NOTREACHED(); |
| 86 return 0; | 86 return 0; |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 | 89 |
| 90 } // namespace | 90 } // namespace |
| 91 | 91 |
| 92 InterpolationValue FilterInterpolationFunctions::maybeConvertCSSFilter(const CSS
Value& value) | 92 InterpolationValue FilterInterpolationFunctions::maybeConvertCSSFilter(const CSS
Value& value) |
| 93 { | 93 { |
| 94 if (value.isURIValue()) |
| 95 return nullptr; |
| 96 |
| 94 const CSSFunctionValue& filter = toCSSFunctionValue(value); | 97 const CSSFunctionValue& filter = toCSSFunctionValue(value); |
| 95 ASSERT(filter.length() <= 1); | 98 DCHECK_LE(filter.length(), 1u); |
| 96 FilterOperation::OperationType type = FilterOperationResolver::filterOperati
onForType(filter.functionType()); | 99 FilterOperation::OperationType type = FilterOperationResolver::filterOperati
onForType(filter.functionType()); |
| 97 InterpolationValue result = nullptr; | 100 InterpolationValue result = nullptr; |
| 98 | 101 |
| 99 switch (type) { | 102 switch (type) { |
| 100 case FilterOperation::BRIGHTNESS: | 103 case FilterOperation::BRIGHTNESS: |
| 101 case FilterOperation::CONTRAST: | 104 case FilterOperation::CONTRAST: |
| 102 case FilterOperation::GRAYSCALE: | 105 case FilterOperation::GRAYSCALE: |
| 103 case FilterOperation::INVERT: | 106 case FilterOperation::INVERT: |
| 104 case FilterOperation::OPACITY: | 107 case FilterOperation::OPACITY: |
| 105 case FilterOperation::SATURATE: | 108 case FilterOperation::SATURATE: |
| (...skipping 23 matching lines...) Expand all Loading... |
| 129 else | 132 else |
| 130 result = CSSLengthInterpolationType::maybeConvertCSSValue(filter.ite
m(0)); | 133 result = CSSLengthInterpolationType::maybeConvertCSSValue(filter.ite
m(0)); |
| 131 break; | 134 break; |
| 132 } | 135 } |
| 133 | 136 |
| 134 case FilterOperation::DROP_SHADOW: { | 137 case FilterOperation::DROP_SHADOW: { |
| 135 result = ShadowInterpolationFunctions::maybeConvertCSSValue(filter.item(
0)); | 138 result = ShadowInterpolationFunctions::maybeConvertCSSValue(filter.item(
0)); |
| 136 break; | 139 break; |
| 137 } | 140 } |
| 138 | 141 |
| 139 case FilterOperation::REFERENCE: | |
| 140 return nullptr; | |
| 141 | |
| 142 default: | 142 default: |
| 143 NOTREACHED(); | 143 NOTREACHED(); |
| 144 return nullptr; | 144 return nullptr; |
| 145 } | 145 } |
| 146 | 146 |
| 147 if (!result) | 147 if (!result) |
| 148 return nullptr; | 148 return nullptr; |
| 149 | 149 |
| 150 result.nonInterpolableValue = FilterNonInterpolableValue::create(type, resul
t.nonInterpolableValue.release()); | 150 result.nonInterpolableValue = FilterNonInterpolableValue::create(type, resul
t.nonInterpolableValue.release()); |
| 151 return result; | 151 return result; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 return DropShadowFilterOperation::create(IntPoint(shadowData.x(), shadow
Data.y()), shadowData.blur(), color); | 261 return DropShadowFilterOperation::create(IntPoint(shadowData.x(), shadow
Data.y()), shadowData.blur(), color); |
| 262 } | 262 } |
| 263 | 263 |
| 264 default: | 264 default: |
| 265 NOTREACHED(); | 265 NOTREACHED(); |
| 266 return nullptr; | 266 return nullptr; |
| 267 } | 267 } |
| 268 } | 268 } |
| 269 | 269 |
| 270 } // namespace blink | 270 } // namespace blink |
| OLD | NEW |