OLD | NEW |
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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 primitiveAttributeChanged(attrName); | 168 primitiveAttributeChanged(attrName); |
169 } | 169 } |
170 | 170 |
171 PassRefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* f
ilterBuilder, Filter* filter) | 171 PassRefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* f
ilterBuilder, Filter* filter) |
172 { | 172 { |
173 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); | 173 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); |
174 | 174 |
175 if (!input1) | 175 if (!input1) |
176 return nullptr; | 176 return nullptr; |
177 | 177 |
178 RefPtr<LightSource> lightSource = SVGFELightElement::findLightSource(*this); | 178 SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*this); |
179 if (!lightSource) | 179 if (!lightNode) |
180 return nullptr; | 180 return nullptr; |
181 | 181 |
182 RenderObject* renderer = this->renderer(); | 182 RenderObject* renderer = this->renderer(); |
183 if (!renderer) | 183 if (!renderer) |
184 return nullptr; | 184 return nullptr; |
185 | 185 |
186 ASSERT(renderer->style()); | 186 ASSERT(renderer->style()); |
187 Color color = renderer->style()->svgStyle()->lightingColor(); | 187 Color color = renderer->style()->svgStyle()->lightingColor(); |
188 | 188 |
| 189 RefPtr<LightSource> lightSource = lightNode->lightSource(filter); |
189 RefPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, m_su
rfaceScale->currentValue()->value(), m_specularConstant->currentValue()->value()
, | 190 RefPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, m_su
rfaceScale->currentValue()->value(), m_specularConstant->currentValue()->value()
, |
190 m_specularExponent->currentValue()->value(), kernelUnitLengthX()->curren
tValue()->value(), kernelUnitLengthY()->currentValue()->value(), lightSource.rel
ease()); | 191 m_specularExponent->currentValue()->value(), kernelUnitLengthX()->curren
tValue()->value(), kernelUnitLengthY()->currentValue()->value(), lightSource.rel
ease()); |
191 effect->inputEffects().append(input1); | 192 effect->inputEffects().append(input1); |
192 return effect.release(); | 193 return effect.release(); |
193 } | 194 } |
194 | 195 |
195 } | 196 } |
OLD | NEW |