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 LayoutObject* layoutObject = this->layoutObject(); | 135 Color color = Color::white; |
136 if (!layoutObject) | 136 if (LayoutObject* layoutObject = this->layoutObject()) { |
137 return nullptr; | 137 ASSERT(layoutObject->style()); |
138 | 138 color = layoutObject->styleRef().svgStyle().lightingColor(); |
139 ASSERT(layoutObject->style()); | 139 } |
140 Color color = layoutObject->style()->svgStyle().lightingColor(); | |
141 | 140 |
142 const SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*th
is); | 141 const SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*th
is); |
143 RefPtr<LightSource> lightSource = lightNode ? lightNode->lightSource(filter)
: nullptr; | 142 RefPtr<LightSource> lightSource = lightNode ? lightNode->lightSource(filter)
: nullptr; |
144 | 143 |
145 RefPtrWillBeRawPtr<FilterEffect> effect = FESpecularLighting::create(filter, | 144 RefPtrWillBeRawPtr<FilterEffect> effect = FESpecularLighting::create(filter, |
146 color, | 145 color, |
147 m_surfaceScale->currentValue()->value(), | 146 m_surfaceScale->currentValue()->value(), |
148 m_specularConstant->currentValue()->value(), | 147 m_specularConstant->currentValue()->value(), |
149 m_specularExponent->currentValue()->value(), | 148 m_specularExponent->currentValue()->value(), |
150 lightSource.release()); | 149 lightSource.release()); |
151 effect->inputEffects().append(input1); | 150 effect->inputEffects().append(input1); |
152 return effect.release(); | 151 return effect.release(); |
153 } | 152 } |
154 | 153 |
155 } // namespace blink | 154 } // namespace blink |
OLD | NEW |