summaryrefslogtreecommitdiff
path: root/Source/WebCore/svg/SVGFEComponentTransferElement.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/svg/SVGFEComponentTransferElement.cpp
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/svg/SVGFEComponentTransferElement.cpp')
-rw-r--r--Source/WebCore/svg/SVGFEComponentTransferElement.cpp44
1 files changed, 13 insertions, 31 deletions
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> SVGFEComponentTransferElement::create(const QualifiedName& tagName, Document& document)
-{
- return adoptRef(new SVGFEComponentTransferElement(tagName, document));
-}
-
-bool SVGFEComponentTransferElement::isSupportedAttribute(const QualifiedName& attrName)
+Ref<SVGFEComponentTransferElement> SVGFEComponentTransferElement::create(const QualifiedName& tagName, Document& document)
{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
- if (supportedAttributes.isEmpty())
- supportedAttributes.add(SVGNames::inAttr);
- return supportedAttributes.contains<SVGAttributeHashTranslator>(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<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
+RefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
{
FilterEffect* input1 = filterBuilder->getEffectById(in1());
@@ -91,21 +75,19 @@ PassRefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder*
ComponentTransferFunction alpha;
for (auto& child : childrenOfType<SVGElement>(*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<SVGFEFuncRElement>(child))
+ red = downcast<SVGFEFuncRElement>(child).transferFunction();
+ else if (is<SVGFEFuncGElement>(child))
+ green = downcast<SVGFEFuncGElement>(child).transferFunction();
+ else if (is<SVGFEFuncBElement>(child))
+ blue = downcast<SVGFEFuncBElement>(child).transferFunction();
+ else if (is<SVGFEFuncAElement>(child))
+ alpha = downcast<SVGFEFuncAElement>(child).transferFunction();
}
RefPtr<FilterEffect> effect = FEComponentTransfer::create(filter, red, green, blue, alpha);
effect->inputEffects().append(input1);
- return effect.release();
+ return effect;
}
}
-
-#endif