| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 SVGFilterPrimitiveStandardAttributes::trace(visitor); | 55 SVGFilterPrimitiveStandardAttributes::trace(visitor); |
| 56 } | 56 } |
| 57 | 57 |
| 58 DEFINE_NODE_FACTORY(SVGFESpecularLightingElement) | 58 DEFINE_NODE_FACTORY(SVGFESpecularLightingElement) |
| 59 | 59 |
| 60 bool SVGFESpecularLightingElement::setFilterEffectAttribute(FilterEffect* effect
, const QualifiedName& attrName) | 60 bool SVGFESpecularLightingElement::setFilterEffectAttribute(FilterEffect* effect
, const QualifiedName& attrName) |
| 61 { | 61 { |
| 62 FESpecularLighting* specularLighting = static_cast<FESpecularLighting*>(effe
ct); | 62 FESpecularLighting* specularLighting = static_cast<FESpecularLighting*>(effe
ct); |
| 63 | 63 |
| 64 if (attrName == SVGNames::lighting_colorAttr) { | 64 if (attrName == SVGNames::lighting_colorAttr) { |
| 65 LayoutObject* renderer = this->layoutObject(); | 65 LayoutObject* layoutObject = this->layoutObject(); |
| 66 ASSERT(renderer); | 66 ASSERT(layoutObject); |
| 67 ASSERT(renderer->style()); | 67 ASSERT(layoutObject->style()); |
| 68 return specularLighting->setLightingColor(renderer->style()->svgStyle().
lightingColor()); | 68 return specularLighting->setLightingColor(layoutObject->style()->svgStyl
e().lightingColor()); |
| 69 } | 69 } |
| 70 if (attrName == SVGNames::surfaceScaleAttr) | 70 if (attrName == SVGNames::surfaceScaleAttr) |
| 71 return specularLighting->setSurfaceScale(m_surfaceScale->currentValue()-
>value()); | 71 return specularLighting->setSurfaceScale(m_surfaceScale->currentValue()-
>value()); |
| 72 if (attrName == SVGNames::specularConstantAttr) | 72 if (attrName == SVGNames::specularConstantAttr) |
| 73 return specularLighting->setSpecularConstant(m_specularConstant->current
Value()->value()); | 73 return specularLighting->setSpecularConstant(m_specularConstant->current
Value()->value()); |
| 74 if (attrName == SVGNames::specularExponentAttr) | 74 if (attrName == SVGNames::specularExponentAttr) |
| 75 return specularLighting->setSpecularExponent(m_specularExponent->current
Value()->value()); | 75 return specularLighting->setSpecularExponent(m_specularExponent->current
Value()->value()); |
| 76 if (attrName == SVGNames::kernelUnitLengthAttr) { | 76 if (attrName == SVGNames::kernelUnitLengthAttr) { |
| 77 bool changedX = specularLighting->setKernelUnitLengthX(m_kernelUnitLengt
h->firstNumber()->currentValue()->value()); | 77 bool changedX = specularLighting->setKernelUnitLengthX(m_kernelUnitLengt
h->firstNumber()->currentValue()->value()); |
| 78 bool changedY = specularLighting->setKernelUnitLengthY(m_kernelUnitLengt
h->secondNumber()->currentValue()->value()); | 78 bool changedY = specularLighting->setKernelUnitLengthY(m_kernelUnitLengt
h->secondNumber()->currentValue()->value()); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 { | 135 { |
| 136 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); | 136 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); |
| 137 | 137 |
| 138 if (!input1) | 138 if (!input1) |
| 139 return nullptr; | 139 return nullptr; |
| 140 | 140 |
| 141 SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*this); | 141 SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*this); |
| 142 if (!lightNode) | 142 if (!lightNode) |
| 143 return nullptr; | 143 return nullptr; |
| 144 | 144 |
| 145 LayoutObject* renderer = this->layoutObject(); | 145 LayoutObject* layoutObject = this->layoutObject(); |
| 146 if (!renderer) | 146 if (!layoutObject) |
| 147 return nullptr; | 147 return nullptr; |
| 148 | 148 |
| 149 ASSERT(renderer->style()); | 149 ASSERT(layoutObject->style()); |
| 150 Color color = renderer->style()->svgStyle().lightingColor(); | 150 Color color = layoutObject->style()->svgStyle().lightingColor(); |
| 151 | 151 |
| 152 RefPtr<LightSource> lightSource = lightNode->lightSource(filter); | 152 RefPtr<LightSource> lightSource = lightNode->lightSource(filter); |
| 153 RefPtrWillBeRawPtr<FilterEffect> effect = FESpecularLighting::create(filter,
color, m_surfaceScale->currentValue()->value(), m_specularConstant->currentValu
e()->value(), | 153 RefPtrWillBeRawPtr<FilterEffect> effect = FESpecularLighting::create(filter,
color, m_surfaceScale->currentValue()->value(), m_specularConstant->currentValu
e()->value(), |
| 154 m_specularExponent->currentValue()->value(), kernelUnitLengthX()->curren
tValue()->value(), kernelUnitLengthY()->currentValue()->value(), lightSource.rel
ease()); | 154 m_specularExponent->currentValue()->value(), kernelUnitLengthX()->curren
tValue()->value(), kernelUnitLengthY()->currentValue()->value(), lightSource.rel
ease()); |
| 155 effect->inputEffects().append(input1); | 155 effect->inputEffects().append(input1); |
| 156 return effect.release(); | 156 return effect.release(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 } // namespace blink | 159 } // namespace blink |
| OLD | NEW |