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

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

Issue 977113003: Rename renderer() to layoutObject(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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
« no previous file with comments | « Source/core/svg/SVGEllipseElement.cpp ('k') | Source/core/svg/SVGFEDropShadowElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/svg/SVGEllipseElement.cpp ('k') | Source/core/svg/SVGFEDropShadowElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698