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

Side by Side Diff: third_party/WebKit/Source/core/svg/graphics/filters/SVGFilterBuilder.cpp

Issue 2346193002: Split CSSPrimitiveValue into CSSPrimitiveValue and CSSIdentifierValue (Closed)
Patch Set: Rebase please work Created 4 years, 2 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) 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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGPathElement.cpp ('k') | third_party/WebKit/Source/web/WebAXObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698