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

Unified Diff: Source/core/rendering/svg/ReferenceFilterBuilder.cpp

Issue 191003007: Use isSVG*Element() helpers more in SVG code (Part 3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderLayerFilterInfo.cpp ('k') | Source/core/rendering/svg/RenderSVGEllipse.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/ReferenceFilterBuilder.cpp
diff --git a/Source/core/rendering/svg/ReferenceFilterBuilder.cpp b/Source/core/rendering/svg/ReferenceFilterBuilder.cpp
index 784d43978233b8b09da544ee642feb652251b9e9..f135c1a3aa49ae5728251445bf98a5f2809315f7 100644
--- a/Source/core/rendering/svg/ReferenceFilterBuilder.cpp
+++ b/Source/core/rendering/svg/ReferenceFilterBuilder.cpp
@@ -134,10 +134,10 @@ PassRefPtr<FilterEffect> ReferenceFilterBuilder::build(Filter* parentFilter, Ren
return nullptr;
}
- if (!filter->isSVGElement() || !filter->hasTagName(SVGNames::filterTag))
+ if (!isSVGFilterElement(*filter))
return nullptr;
- SVGFilterElement* filterElement = toSVGFilterElement(toSVGElement(filter));
+ SVGFilterElement& filterElement = toSVGFilterElement(*filter);
// FIXME: Figure out what to do with SourceAlpha. Right now, we're
// using the alpha of the original input layer, which is obviously
@@ -147,9 +147,9 @@ PassRefPtr<FilterEffect> ReferenceFilterBuilder::build(Filter* parentFilter, Ren
RefPtr<SVGFilterBuilder> builder = SVGFilterBuilder::create(previousEffect, SourceAlpha::create(parentFilter));
ColorSpace filterColorSpace = ColorSpaceDeviceRGB;
- bool useFilterColorSpace = getSVGElementColorSpace(filterElement, filterColorSpace);
+ bool useFilterColorSpace = getSVGElementColorSpace(&filterElement, filterColorSpace);
- for (SVGElement* element = Traversal<SVGElement>::firstChild(*filterElement); element; element = Traversal<SVGElement>::nextSibling(*element)) {
+ for (SVGElement* element = Traversal<SVGElement>::firstChild(filterElement); element; element = Traversal<SVGElement>::nextSibling(*element)) {
if (!element->isFilterEffect())
continue;
@@ -160,7 +160,7 @@ PassRefPtr<FilterEffect> ReferenceFilterBuilder::build(Filter* parentFilter, Ren
continue;
effectElement->setStandardAttributes(effect.get());
- effect->setEffectBoundaries(SVGLengthContext::resolveRectangle<SVGFilterPrimitiveStandardAttributes>(effectElement, filterElement->primitiveUnits()->currentValue()->enumValue(), parentFilter->sourceImageRect()));
+ effect->setEffectBoundaries(SVGLengthContext::resolveRectangle<SVGFilterPrimitiveStandardAttributes>(effectElement, filterElement.primitiveUnits()->currentValue()->enumValue(), parentFilter->sourceImageRect()));
ColorSpace colorSpace = filterColorSpace;
if (useFilterColorSpace || getSVGElementColorSpace(effectElement, colorSpace))
effect->setOperatingColorSpace(colorSpace);
« no previous file with comments | « Source/core/rendering/RenderLayerFilterInfo.cpp ('k') | Source/core/rendering/svg/RenderSVGEllipse.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698