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

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

Issue 1350903009: Update handling of negative std.dev for feGaussianblur/feDropShadow (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/SVGFEDropShadowElement.cpp
diff --git a/Source/core/svg/SVGFEDropShadowElement.cpp b/Source/core/svg/SVGFEDropShadowElement.cpp
index 932e30e67e55f11db9e4917e2381d78b8880c3f5..24775e128e36b86bfa9db5dbe66bbbbb282017b1 100644
--- a/Source/core/svg/SVGFEDropShadowElement.cpp
+++ b/Source/core/svg/SVGFEDropShadowElement.cpp
@@ -80,9 +80,6 @@ PassRefPtrWillBeRawPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuil
if (!layoutObject)
return nullptr;
- if (stdDeviationX()->currentValue()->value() < 0 || stdDeviationY()->currentValue()->value() < 0)
- return nullptr;
-
ASSERT(layoutObject->style());
const SVGComputedStyle& svgStyle = layoutObject->style()->svgStyle();
@@ -93,7 +90,10 @@ PassRefPtrWillBeRawPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuil
if (!input1)
return nullptr;
- RefPtrWillBeRawPtr<FilterEffect> effect = FEDropShadow::create(filter, stdDeviationX()->currentValue()->value(), stdDeviationY()->currentValue()->value(), m_dx->currentValue()->value(), m_dy->currentValue()->value(), color, opacity);
+ // Clamp std.dev. to non-negative. (See SVGFEGaussianBlurElement::build)
+ float stdDevX = std::max(0.0f, stdDeviationX()->currentValue()->value());
+ float stdDevY = std::max(0.0f, stdDeviationY()->currentValue()->value());
+ RefPtrWillBeRawPtr<FilterEffect> effect = FEDropShadow::create(filter, stdDevX, stdDevY, m_dx->currentValue()->value(), m_dy->currentValue()->value(), color, opacity);
effect->inputEffects().append(input1);
return effect.release();
}
« no previous file with comments | « LayoutTests/svg/filters/feGaussianBlur-negative-deviation-expected.svg ('k') | Source/core/svg/SVGFEGaussianBlurElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698