OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005 Oliver Hunt <ojh16@student.canterbury.ac.nz> | 2 * Copyright (C) 2005 Oliver Hunt <ojh16@student.canterbury.ac.nz> |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 void SVGFEDiffuseLightingElement::parseAttribute(const QualifiedName& name, cons
t AtomicString& value) | 69 void SVGFEDiffuseLightingElement::parseAttribute(const QualifiedName& name, cons
t AtomicString& value) |
70 { | 70 { |
71 parseAttributeNew(name, value); | 71 parseAttributeNew(name, value); |
72 } | 72 } |
73 | 73 |
74 bool SVGFEDiffuseLightingElement::setFilterEffectAttribute(FilterEffect* effect,
const QualifiedName& attrName) | 74 bool SVGFEDiffuseLightingElement::setFilterEffectAttribute(FilterEffect* effect,
const QualifiedName& attrName) |
75 { | 75 { |
76 FEDiffuseLighting* diffuseLighting = static_cast<FEDiffuseLighting*>(effect)
; | 76 FEDiffuseLighting* diffuseLighting = static_cast<FEDiffuseLighting*>(effect)
; |
77 | 77 |
78 if (attrName == SVGNames::lighting_colorAttr) { | 78 if (attrName == SVGNames::lighting_colorAttr) { |
79 LayoutObject* renderer = this->renderer(); | 79 LayoutObject* renderer = this->layoutObject(); |
80 ASSERT(renderer); | 80 ASSERT(renderer); |
81 ASSERT(renderer->style()); | 81 ASSERT(renderer->style()); |
82 return diffuseLighting->setLightingColor(renderer->style()->svgStyle().l
ightingColor()); | 82 return diffuseLighting->setLightingColor(renderer->style()->svgStyle().l
ightingColor()); |
83 } | 83 } |
84 if (attrName == SVGNames::surfaceScaleAttr) | 84 if (attrName == SVGNames::surfaceScaleAttr) |
85 return diffuseLighting->setSurfaceScale(m_surfaceScale->currentValue()->
value()); | 85 return diffuseLighting->setSurfaceScale(m_surfaceScale->currentValue()->
value()); |
86 if (attrName == SVGNames::diffuseConstantAttr) | 86 if (attrName == SVGNames::diffuseConstantAttr) |
87 return diffuseLighting->setDiffuseConstant(m_diffuseConstant->currentVal
ue()->value()); | 87 return diffuseLighting->setDiffuseConstant(m_diffuseConstant->currentVal
ue()->value()); |
88 if (attrName == SVGNames::kernelUnitLengthAttr) { | 88 if (attrName == SVGNames::kernelUnitLengthAttr) { |
89 bool changedX = diffuseLighting->setKernelUnitLengthX(m_kernelUnitLength
->firstNumber()->currentValue()->value()); | 89 bool changedX = diffuseLighting->setKernelUnitLengthX(m_kernelUnitLength
->firstNumber()->currentValue()->value()); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 { | 152 { |
153 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); | 153 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); |
154 | 154 |
155 if (!input1) | 155 if (!input1) |
156 return nullptr; | 156 return nullptr; |
157 | 157 |
158 SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*this); | 158 SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*this); |
159 if (!lightNode) | 159 if (!lightNode) |
160 return nullptr; | 160 return nullptr; |
161 | 161 |
162 LayoutObject* renderer = this->renderer(); | 162 LayoutObject* renderer = this->layoutObject(); |
163 if (!renderer) | 163 if (!renderer) |
164 return nullptr; | 164 return nullptr; |
165 | 165 |
166 ASSERT(renderer->style()); | 166 ASSERT(renderer->style()); |
167 Color color = renderer->style()->svgStyle().lightingColor(); | 167 Color color = renderer->style()->svgStyle().lightingColor(); |
168 | 168 |
169 RefPtr<LightSource> lightSource = lightNode->lightSource(filter); | 169 RefPtr<LightSource> lightSource = lightNode->lightSource(filter); |
170 RefPtrWillBeRawPtr<FilterEffect> effect = FEDiffuseLighting::create(filter,
color, m_surfaceScale->currentValue()->value(), m_diffuseConstant->currentValue(
)->value(), | 170 RefPtrWillBeRawPtr<FilterEffect> effect = FEDiffuseLighting::create(filter,
color, m_surfaceScale->currentValue()->value(), m_diffuseConstant->currentValue(
)->value(), |
171 kernelUnitLengthX()->currentValue()->value(), kernelUnitLengthY()->curre
ntValue()->value(), lightSource.release()); | 171 kernelUnitLengthX()->currentValue()->value(), kernelUnitLengthY()->curre
ntValue()->value(), lightSource.release()); |
172 effect->inputEffects().append(input1); | 172 effect->inputEffects().append(input1); |
173 return effect.release(); | 173 return effect.release(); |
174 } | 174 } |
175 | 175 |
176 } // namespace blink | 176 } // namespace blink |
OLD | NEW |