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

Unified Diff: third_party/WebKit/Source/core/svg/SVGFEDiffuseLightingElement.cpp

Issue 1375793003: Update error-handling for fe*Lighting and feTurbulence (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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: third_party/WebKit/Source/core/svg/SVGFEDiffuseLightingElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGFEDiffuseLightingElement.cpp b/third_party/WebKit/Source/core/svg/SVGFEDiffuseLightingElement.cpp
index 291e05291576696d03112be88f808308806c113f..791b0c8ef4911905fa5eae52720cf55403469689 100644
--- a/third_party/WebKit/Source/core/svg/SVGFEDiffuseLightingElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGFEDiffuseLightingElement.cpp
@@ -126,10 +126,6 @@ PassRefPtrWillBeRawPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilte
if (!input1)
return nullptr;
- SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*this);
- if (!lightNode)
- return nullptr;
-
LayoutObject* layoutObject = this->layoutObject();
if (!layoutObject)
return nullptr;
@@ -137,8 +133,13 @@ PassRefPtrWillBeRawPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilte
ASSERT(layoutObject->style());
Color color = layoutObject->style()->svgStyle().lightingColor();
- RefPtr<LightSource> lightSource = lightNode->lightSource(filter);
- RefPtrWillBeRawPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, color, m_surfaceScale->currentValue()->value(), m_diffuseConstant->currentValue()->value(),
+ const SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*this);
+ RefPtr<LightSource> lightSource = lightNode ? lightNode->lightSource(filter) : nullptr;
+
+ RefPtrWillBeRawPtr<FilterEffect> effect = FEDiffuseLighting::create(filter,
+ color,
+ m_surfaceScale->currentValue()->value(),
+ m_diffuseConstant->currentValue()->value(),
lightSource.release());
effect->inputEffects().append(input1);
return effect.release();

Powered by Google App Engine
This is Rietveld 408576698