OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // Returns the color-interpolation-filters property of the element. | 141 // Returns the color-interpolation-filters property of the element. |
142 static EColorInterpolation colorInterpolationForElement(SVGElement& element, ECo
lorInterpolation parentColorInterpolation) | 142 static EColorInterpolation colorInterpolationForElement(SVGElement& element, ECo
lorInterpolation parentColorInterpolation) |
143 { | 143 { |
144 if (const LayoutObject* layoutObject = element.layoutObject()) | 144 if (const LayoutObject* layoutObject = element.layoutObject()) |
145 return layoutObject->styleRef().svgStyle().colorInterpolationFilters(); | 145 return layoutObject->styleRef().svgStyle().colorInterpolationFilters(); |
146 | 146 |
147 // No layout has been performed, try to determine the property value | 147 // No layout has been performed, try to determine the property value |
148 // "manually" (used by external SVG files.) | 148 // "manually" (used by external SVG files.) |
149 if (const StylePropertySet* propertySet = element.presentationAttributeStyle
()) { | 149 if (const StylePropertySet* propertySet = element.presentationAttributeStyle
()) { |
150 const CSSValue* cssValue = propertySet->getPropertyCSSValue(CSSPropertyC
olorInterpolationFilters); | 150 const CSSValue* cssValue = propertySet->getPropertyCSSValue(CSSPropertyC
olorInterpolationFilters); |
151 if (cssValue && cssValue->isPrimitiveValue()) { | 151 if (cssValue && cssValue->isIdentifierValue()) { |
152 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(*cssVa
lue); | 152 return toCSSIdentifierValue(*cssValue).convertTo<EColorInterpolation
>(); |
153 return primitiveValue.convertTo<EColorInterpolation>(); | |
154 } | 153 } |
155 } | 154 } |
156 // 'auto' is the default (per Filter Effects), but since the property is | 155 // 'auto' is the default (per Filter Effects), but since the property is |
157 // inherited, propagate the parent's value. | 156 // inherited, propagate the parent's value. |
158 return parentColorInterpolation; | 157 return parentColorInterpolation; |
159 } | 158 } |
160 | 159 |
161 ColorSpace SVGFilterBuilder::resolveColorSpace(EColorInterpolation colorInterpol
ation) | 160 ColorSpace SVGFilterBuilder::resolveColorSpace(EColorInterpolation colorInterpol
ation) |
162 { | 161 { |
163 return colorInterpolation == CI_LINEARRGB ? ColorSpaceLinearRGB : ColorSpace
DeviceRGB; | 162 return colorInterpolation == CI_LINEARRGB ? ColorSpaceLinearRGB : ColorSpace
DeviceRGB; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 return namedEffect; | 213 return namedEffect; |
215 } | 214 } |
216 | 215 |
217 if (m_lastEffect) | 216 if (m_lastEffect) |
218 return m_lastEffect.get(); | 217 return m_lastEffect.get(); |
219 | 218 |
220 return m_builtinEffects.get(FilterInputKeywords::getSourceGraphic()); | 219 return m_builtinEffects.get(FilterInputKeywords::getSourceGraphic()); |
221 } | 220 } |
222 | 221 |
223 } // namespace blink | 222 } // namespace blink |
OLD | NEW |