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

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

Issue 337903003: Map light-source oBB-relative coordinates to the user-space of the filter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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) 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 primitiveAttributeChanged(attrName); 161 primitiveAttributeChanged(attrName);
162 } 162 }
163 163
164 PassRefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* fi lterBuilder, Filter* filter) 164 PassRefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* fi lterBuilder, Filter* filter)
165 { 165 {
166 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr entValue()->value())); 166 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr entValue()->value()));
167 167
168 if (!input1) 168 if (!input1)
169 return nullptr; 169 return nullptr;
170 170
171 RefPtr<LightSource> lightSource = SVGFELightElement::findLightSource(*this); 171 SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*this);
172 if (!lightSource) 172 if (!lightNode)
173 return nullptr; 173 return nullptr;
174 174
175 RenderObject* renderer = this->renderer(); 175 RenderObject* renderer = this->renderer();
176 if (!renderer) 176 if (!renderer)
177 return nullptr; 177 return nullptr;
178 178
179 ASSERT(renderer->style()); 179 ASSERT(renderer->style());
180 Color color = renderer->style()->svgStyle()->lightingColor(); 180 Color color = renderer->style()->svgStyle()->lightingColor();
181 181
182 RefPtr<LightSource> lightSource = lightNode->lightSource(filter);
182 RefPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, color, m_sur faceScale->currentValue()->value(), m_diffuseConstant->currentValue()->value(), 183 RefPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, color, m_sur faceScale->currentValue()->value(), m_diffuseConstant->currentValue()->value(),
183 kernelUnitLengthX()->currentValue()->value(), kernelUnitLengthY()->curre ntValue()->value(), lightSource.release()); 184 kernelUnitLengthX()->currentValue()->value(), kernelUnitLengthY()->curre ntValue()->value(), lightSource.release());
184 effect->inputEffects().append(input1); 185 effect->inputEffects().append(input1);
185 return effect.release(); 186 return effect.release();
186 } 187 }
187 188
188 } 189 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698