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

Unified Diff: Source/core/svg/SVGFEMorphologyElement.cpp

Issue 1344283004: Update handling of negative radius for feMorphology (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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
Index: Source/core/svg/SVGFEMorphologyElement.cpp
diff --git a/Source/core/svg/SVGFEMorphologyElement.cpp b/Source/core/svg/SVGFEMorphologyElement.cpp
index b39fcee4ad098485cefee99c0d6c82c385f96eae..9c36d646988196ba7b476316f0078077a4c0819d 100644
--- a/Source/core/svg/SVGFEMorphologyElement.cpp
+++ b/Source/core/svg/SVGFEMorphologyElement.cpp
@@ -95,15 +95,17 @@ void SVGFEMorphologyElement::svgAttributeChanged(const QualifiedName& attrName)
PassRefPtrWillBeRawPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
{
FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->currentValue()->value()));
- float xRadius = radiusX()->currentValue()->value();
- float yRadius = radiusY()->currentValue()->value();
if (!input1)
return nullptr;
- if (xRadius < 0 || yRadius < 0)
- return nullptr;
-
+ // "A negative or zero value disables the effect of the given filter
+ // primitive (i.e., the result is the filter input image)."
+ // https://drafts.fxtf.org/filters/#element-attrdef-femorphology-radius
+ //
+ // (This is handled by FEMorphology)
+ float xRadius = radiusX()->currentValue()->value();
+ float yRadius = radiusY()->currentValue()->value();
RefPtrWillBeRawPtr<FilterEffect> effect = FEMorphology::create(filter, m_svgOperator->currentValue()->enumValue(), xRadius, yRadius);
effect->inputEffects().append(input1);
return effect.release();
« no previous file with comments | « LayoutTests/svg/filters/feMorphology-negative-radius-expected.html ('k') | Source/platform/graphics/filters/FEMorphology.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698