| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |