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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 if (SVGFELightElement::findLightElement(*this) != lightElement) | 121 if (SVGFELightElement::findLightElement(*this) != lightElement) |
122 return; | 122 return; |
123 | 123 |
124 // The light element has different attribute names so attrName can identify
the requested attribute. | 124 // The light element has different attribute names so attrName can identify
the requested attribute. |
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 ASSERT(input1); |
132 if (!input1) | |
133 return nullptr; | |
134 | 132 |
135 LayoutObject* layoutObject = this->layoutObject(); | 133 LayoutObject* layoutObject = this->layoutObject(); |
136 if (!layoutObject) | 134 if (!layoutObject) |
137 return nullptr; | 135 return nullptr; |
138 | 136 |
139 ASSERT(layoutObject->style()); | 137 ASSERT(layoutObject->style()); |
140 Color color = layoutObject->style()->svgStyle().lightingColor(); | 138 Color color = layoutObject->style()->svgStyle().lightingColor(); |
141 | 139 |
142 const SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*th
is); | 140 const SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*th
is); |
143 RefPtr<LightSource> lightSource = lightNode ? lightNode->lightSource(filter)
: nullptr; | 141 RefPtr<LightSource> lightSource = lightNode ? lightNode->lightSource(filter)
: nullptr; |
144 | 142 |
145 RefPtrWillBeRawPtr<FilterEffect> effect = FESpecularLighting::create(filter, | 143 RefPtrWillBeRawPtr<FilterEffect> effect = FESpecularLighting::create(filter, |
146 color, | 144 color, |
147 m_surfaceScale->currentValue()->value(), | 145 m_surfaceScale->currentValue()->value(), |
148 m_specularConstant->currentValue()->value(), | 146 m_specularConstant->currentValue()->value(), |
149 m_specularExponent->currentValue()->value(), | 147 m_specularExponent->currentValue()->value(), |
150 lightSource.release()); | 148 lightSource.release()); |
151 effect->inputEffects().append(input1); | 149 effect->inputEffects().append(input1); |
152 return effect.release(); | 150 return effect.release(); |
153 } | 151 } |
154 | 152 |
155 } // namespace blink | 153 } // namespace blink |
OLD | NEW |