Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: Source/core/svg/SVGFESpecularLightingElement.cpp

Issue 19097005: Remove one SVG animated type special case from the bindings generator (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix the regressions Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 { 135 {
136 FESpecularLighting* specularLighting = static_cast<FESpecularLighting*>(effe ct); 136 FESpecularLighting* specularLighting = static_cast<FESpecularLighting*>(effe ct);
137 137
138 if (attrName == SVGNames::lighting_colorAttr) { 138 if (attrName == SVGNames::lighting_colorAttr) {
139 RenderObject* renderer = this->renderer(); 139 RenderObject* renderer = this->renderer();
140 ASSERT(renderer); 140 ASSERT(renderer);
141 ASSERT(renderer->style()); 141 ASSERT(renderer->style());
142 return specularLighting->setLightingColor(renderer->style()->svgStyle()- >lightingColor()); 142 return specularLighting->setLightingColor(renderer->style()->svgStyle()- >lightingColor());
143 } 143 }
144 if (attrName == SVGNames::surfaceScaleAttr) 144 if (attrName == SVGNames::surfaceScaleAttr)
145 return specularLighting->setSurfaceScale(surfaceScale()); 145 return specularLighting->setSurfaceScale(surfaceScaleCurrentValue());
146 if (attrName == SVGNames::specularConstantAttr) 146 if (attrName == SVGNames::specularConstantAttr)
147 return specularLighting->setSpecularConstant(specularConstant()); 147 return specularLighting->setSpecularConstant(specularConstantCurrentValu e());
148 if (attrName == SVGNames::specularExponentAttr) 148 if (attrName == SVGNames::specularExponentAttr)
149 return specularLighting->setSpecularExponent(specularExponent()); 149 return specularLighting->setSpecularExponent(specularExponentCurrentValu e());
150 150
151 LightSource* lightSource = const_cast<LightSource*>(specularLighting->lightS ource()); 151 LightSource* lightSource = const_cast<LightSource*>(specularLighting->lightS ource());
152 const SVGFELightElement* lightElement = SVGFELightElement::findLightElement( this); 152 const SVGFELightElement* lightElement = SVGFELightElement::findLightElement( this);
153 ASSERT(lightSource); 153 ASSERT(lightSource);
154 ASSERT(lightElement); 154 ASSERT(lightElement);
155 155
156 if (attrName == SVGNames::azimuthAttr) 156 if (attrName == SVGNames::azimuthAttr)
157 return lightSource->setAzimuth(lightElement->azimuth()); 157 return lightSource->setAzimuth(lightElement->azimuthCurrentValue());
158 if (attrName == SVGNames::elevationAttr) 158 if (attrName == SVGNames::elevationAttr)
159 return lightSource->setElevation(lightElement->elevation()); 159 return lightSource->setElevation(lightElement->elevationCurrentValue());
160 if (attrName == SVGNames::xAttr) 160 if (attrName == SVGNames::xAttr)
161 return lightSource->setX(lightElement->x()); 161 return lightSource->setX(lightElement->xCurrentValue());
162 if (attrName == SVGNames::yAttr) 162 if (attrName == SVGNames::yAttr)
163 return lightSource->setY(lightElement->y()); 163 return lightSource->setY(lightElement->yCurrentValue());
164 if (attrName == SVGNames::zAttr) 164 if (attrName == SVGNames::zAttr)
165 return lightSource->setZ(lightElement->z()); 165 return lightSource->setZ(lightElement->zCurrentValue());
166 if (attrName == SVGNames::pointsAtXAttr) 166 if (attrName == SVGNames::pointsAtXAttr)
167 return lightSource->setPointsAtX(lightElement->pointsAtX()); 167 return lightSource->setPointsAtX(lightElement->pointsAtXCurrentValue());
168 if (attrName == SVGNames::pointsAtYAttr) 168 if (attrName == SVGNames::pointsAtYAttr)
169 return lightSource->setPointsAtY(lightElement->pointsAtY()); 169 return lightSource->setPointsAtY(lightElement->pointsAtYCurrentValue());
170 if (attrName == SVGNames::pointsAtZAttr) 170 if (attrName == SVGNames::pointsAtZAttr)
171 return lightSource->setPointsAtZ(lightElement->pointsAtZ()); 171 return lightSource->setPointsAtZ(lightElement->pointsAtZCurrentValue());
172 if (attrName == SVGNames::specularExponentAttr) 172 if (attrName == SVGNames::specularExponentAttr)
173 return lightSource->setSpecularExponent(lightElement->specularExponent() ); 173 return lightSource->setSpecularExponent(lightElement->specularExponentCu rrentValue());
174 if (attrName == SVGNames::limitingConeAngleAttr) 174 if (attrName == SVGNames::limitingConeAngleAttr)
175 return lightSource->setLimitingConeAngle(lightElement->limitingConeAngle ()); 175 return lightSource->setLimitingConeAngle(lightElement->limitingConeAngle CurrentValue());
176 176
177 ASSERT_NOT_REACHED(); 177 ASSERT_NOT_REACHED();
178 return false; 178 return false;
179 } 179 }
180 180
181 void SVGFESpecularLightingElement::svgAttributeChanged(const QualifiedName& attr Name) 181 void SVGFESpecularLightingElement::svgAttributeChanged(const QualifiedName& attr Name)
182 { 182 {
183 if (!isSupportedAttribute(attrName)) { 183 if (!isSupportedAttribute(attrName)) {
184 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); 184 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
185 return; 185 return;
(...skipping 21 matching lines...) Expand all
207 { 207 {
208 if (SVGFELightElement::findLightElement(this) != lightElement) 208 if (SVGFELightElement::findLightElement(this) != lightElement)
209 return; 209 return;
210 210
211 // The light element has different attribute names so attrName can identify the requested attribute. 211 // The light element has different attribute names so attrName can identify the requested attribute.
212 primitiveAttributeChanged(attrName); 212 primitiveAttributeChanged(attrName);
213 } 213 }
214 214
215 PassRefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* f ilterBuilder, Filter* filter) 215 PassRefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* f ilterBuilder, Filter* filter)
216 { 216 {
217 FilterEffect* input1 = filterBuilder->getEffectById(in1()); 217 FilterEffect* input1 = filterBuilder->getEffectById(in1CurrentValue());
218 218
219 if (!input1) 219 if (!input1)
220 return 0; 220 return 0;
221 221
222 RefPtr<LightSource> lightSource = SVGFELightElement::findLightSource(this); 222 RefPtr<LightSource> lightSource = SVGFELightElement::findLightSource(this);
223 if (!lightSource) 223 if (!lightSource)
224 return 0; 224 return 0;
225 225
226 RenderObject* renderer = this->renderer(); 226 RenderObject* renderer = this->renderer();
227 if (!renderer) 227 if (!renderer)
228 return 0; 228 return 0;
229 229
230 ASSERT(renderer->style()); 230 ASSERT(renderer->style());
231 Color color = renderer->style()->svgStyle()->lightingColor(); 231 Color color = renderer->style()->svgStyle()->lightingColor();
232 232
233 RefPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, surf aceScale(), specularConstant(), 233 RefPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, surf aceScaleCurrentValue(), specularConstantCurrentValue(),
234 specularExponent(), kernelUnitLengthX( ), kernelUnitLengthY(), lightSource.release()); 234 specularExponentCurrentValue(), kernelUnitLengthXCurrentValue(), kernelU nitLengthYCurrentValue(), lightSource.release());
235 effect->inputEffects().append(input1); 235 effect->inputEffects().append(input1);
236 return effect.release(); 236 return effect.release();
237 } 237 }
238 238
239 } 239 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698