From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- .../WebCore/svg/SVGFEComponentTransferElement.cpp | 44 +++++++--------------- 1 file changed, 13 insertions(+), 31 deletions(-) (limited to 'Source/WebCore/svg/SVGFEComponentTransferElement.cpp') diff --git a/Source/WebCore/svg/SVGFEComponentTransferElement.cpp b/Source/WebCore/svg/SVGFEComponentTransferElement.cpp index 3e493fe63..5c1d2503c 100644 --- a/Source/WebCore/svg/SVGFEComponentTransferElement.cpp +++ b/Source/WebCore/svg/SVGFEComponentTransferElement.cpp @@ -19,11 +19,8 @@ */ #include "config.h" - -#if ENABLE(SVG) && ENABLE(FILTERS) #include "SVGFEComponentTransferElement.h" -#include "Attr.h" #include "ElementIterator.h" #include "FilterEffect.h" #include "SVGFEFuncAElement.h" @@ -50,35 +47,22 @@ inline SVGFEComponentTransferElement::SVGFEComponentTransferElement(const Qualif registerAnimatedPropertiesForSVGFEComponentTransferElement(); } -PassRefPtr SVGFEComponentTransferElement::create(const QualifiedName& tagName, Document& document) -{ - return adoptRef(new SVGFEComponentTransferElement(tagName, document)); -} - -bool SVGFEComponentTransferElement::isSupportedAttribute(const QualifiedName& attrName) +Ref SVGFEComponentTransferElement::create(const QualifiedName& tagName, Document& document) { - DEFINE_STATIC_LOCAL(HashSet, supportedAttributes, ()); - if (supportedAttributes.isEmpty()) - supportedAttributes.add(SVGNames::inAttr); - return supportedAttributes.contains(attrName); + return adoptRef(*new SVGFEComponentTransferElement(tagName, document)); } void SVGFEComponentTransferElement::parseAttribute(const QualifiedName& name, const AtomicString& value) { - if (!isSupportedAttribute(name)) { - SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); - return; - } - if (name == SVGNames::inAttr) { setIn1BaseValue(value); return; } - ASSERT_NOT_REACHED(); + SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); } -PassRefPtr SVGFEComponentTransferElement::build(SVGFilterBuilder* filterBuilder, Filter* filter) +RefPtr SVGFEComponentTransferElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) { FilterEffect* input1 = filterBuilder->getEffectById(in1()); @@ -91,21 +75,19 @@ PassRefPtr SVGFEComponentTransferElement::build(SVGFilterBuilder* ComponentTransferFunction alpha; for (auto& child : childrenOfType(*this)) { - if (isSVGFEFuncRElement(child)) - red = toSVGFEFuncRElement(child).transferFunction(); - else if (isSVGFEFuncGElement(child)) - green = toSVGFEFuncGElement(child).transferFunction(); - else if (isSVGFEFuncBElement(child)) - blue = toSVGFEFuncBElement(child).transferFunction(); - else if (isSVGFEFuncAElement(child)) - alpha = toSVGFEFuncAElement(child).transferFunction(); + if (is(child)) + red = downcast(child).transferFunction(); + else if (is(child)) + green = downcast(child).transferFunction(); + else if (is(child)) + blue = downcast(child).transferFunction(); + else if (is(child)) + alpha = downcast(child).transferFunction(); } RefPtr effect = FEComponentTransfer::create(filter, red, green, blue, alpha); effect->inputEffects().append(input1); - return effect.release(); + return effect; } } - -#endif -- cgit v1.2.1