PassRefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filterBuilder) { FilterEffect* input1 = filterBuilder->getEffectById(in1()); if (!input1) return 0; RefPtr<RenderStyle> filterStyle = styleForRenderer(); Color color = filterStyle->svgStyle()->lightingColor(); return FEDiffuseLighting::create(input1, color, surfaceScale(), diffuseConstant(), kernelUnitLengthX(), kernelUnitLengthY(), findLights()); }
bool SVGFEDiffuseLightingElement::build(SVGResourceFilter* filterResource) { FilterEffect* input1 = filterResource->builder()->getEffectById(in1()); if (!input1) return false; RefPtr<RenderStyle> filterStyle = styleForRenderer(); Color color = filterStyle->svgStyle()->lightingColor(); RefPtr<FilterEffect> effect = FEDiffuseLighting::create(input1, color, surfaceScale(), diffuseConstant(), kernelUnitLengthX(), kernelUnitLengthY(), findLights()); filterResource->addFilterEffect(this, effect.release()); return true; }
bool SVGFEDiffuseLightingElement::build(FilterBuilder* builder) { FilterEffect* input1 = builder->getEffectById(in1()); if(!input1) return false; RefPtr<RenderStyle> filterStyle = styleForRenderer(); Color color = filterStyle->svgStyle()->lightingColor(); RefPtr<FilterEffect> addedEffect = FEDiffuseLighting::create(input1, color, surfaceScale(), diffuseConstant(), kernelUnitLengthX(), kernelUnitLengthY(), findLights()); builder->add(result(), addedEffect.release()); return true; }
PassRefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filterBuilder, Filter* filter) { FilterEffect* input1 = filterBuilder->getEffectById(in1()); if (!input1) return 0; RefPtr<RenderStyle> filterStyle = styleForRenderer(); Color color = filterStyle->svgStyle()->lightingColor(); RefPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, surfaceScale(), specularConstant(), specularExponent(), kernelUnitLengthX(), kernelUnitLengthY(), findLights()); effect->inputEffects().append(input1); return effect.release(); }