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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.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, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
4 * Copyright (C) 2005 Oliver Hunt <oliver@nerget.com> 4 * Copyright (C) 2005 Oliver Hunt <oliver@nerget.com>
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 primitiveAttributeChanged(attrName); 125 primitiveAttributeChanged(attrName);
126 } 126 }
127 127
128 PassRefPtrWillBeRawPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilt erBuilder* filterBuilder, Filter* filter) 128 PassRefPtrWillBeRawPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilt erBuilder* filterBuilder, Filter* filter)
129 { 129 {
130 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr entValue()->value())); 130 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr entValue()->value()));
131 131
132 if (!input1) 132 if (!input1)
133 return nullptr; 133 return nullptr;
134 134
135 SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*this);
136 if (!lightNode)
137 return nullptr;
138
139 LayoutObject* layoutObject = this->layoutObject(); 135 LayoutObject* layoutObject = this->layoutObject();
140 if (!layoutObject) 136 if (!layoutObject)
141 return nullptr; 137 return nullptr;
142 138
143 ASSERT(layoutObject->style()); 139 ASSERT(layoutObject->style());
144 Color color = layoutObject->style()->svgStyle().lightingColor(); 140 Color color = layoutObject->style()->svgStyle().lightingColor();
145 141
146 RefPtr<LightSource> lightSource = lightNode->lightSource(filter); 142 const SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*th is);
147 RefPtrWillBeRawPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, m_surfaceScale->currentValue()->value(), m_specularConstant->currentValu e()->value(), 143 RefPtr<LightSource> lightSource = lightNode ? lightNode->lightSource(filter) : nullptr;
148 m_specularExponent->currentValue()->value(), lightSource.release()); 144
145 RefPtrWillBeRawPtr<FilterEffect> effect = FESpecularLighting::create(filter,
146 color,
147 m_surfaceScale->currentValue()->value(),
148 m_specularConstant->currentValue()->value(),
149 m_specularExponent->currentValue()->value(),
150 lightSource.release());
149 effect->inputEffects().append(input1); 151 effect->inputEffects().append(input1);
150 return effect.release(); 152 return effect.release();
151 } 153 }
152 154
153 } // namespace blink 155 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698