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

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

Issue 1383013002: SVGFilterBuilder::getEffectById never return nullptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 if (SVGFELightElement::findLightElement(*this) != lightElement) 121 if (SVGFELightElement::findLightElement(*this) != lightElement)
122 return; 122 return;
123 123
124 // The light element has different attribute names so attrName can identify the requested attribute. 124 // The light element has different attribute names so attrName can identify the requested attribute.
125 primitiveAttributeChanged(attrName); 125 primitiveAttributeChanged(attrName);
126 } 126 }
127 127
128 PassRefPtrWillBeRawPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilt erBuilder* filterBuilder, Filter* filter) 128 PassRefPtrWillBeRawPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilt erBuilder* filterBuilder, Filter* filter)
129 { 129 {
130 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr entValue()->value())); 130 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr entValue()->value()));
131 131 ASSERT(input1);
132 if (!input1)
133 return nullptr;
134 132
135 LayoutObject* layoutObject = this->layoutObject(); 133 LayoutObject* layoutObject = this->layoutObject();
136 if (!layoutObject) 134 if (!layoutObject)
137 return nullptr; 135 return nullptr;
138 136
139 ASSERT(layoutObject->style()); 137 ASSERT(layoutObject->style());
140 Color color = layoutObject->style()->svgStyle().lightingColor(); 138 Color color = layoutObject->style()->svgStyle().lightingColor();
141 139
142 const SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*th is); 140 const SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*th is);
143 RefPtr<LightSource> lightSource = lightNode ? lightNode->lightSource(filter) : nullptr; 141 RefPtr<LightSource> lightSource = lightNode ? lightNode->lightSource(filter) : nullptr;
144 142
145 RefPtrWillBeRawPtr<FilterEffect> effect = FESpecularLighting::create(filter, 143 RefPtrWillBeRawPtr<FilterEffect> effect = FESpecularLighting::create(filter,
146 color, 144 color,
147 m_surfaceScale->currentValue()->value(), 145 m_surfaceScale->currentValue()->value(),
148 m_specularConstant->currentValue()->value(), 146 m_specularConstant->currentValue()->value(),
149 m_specularExponent->currentValue()->value(), 147 m_specularExponent->currentValue()->value(),
150 lightSource.release()); 148 lightSource.release());
151 effect->inputEffects().append(input1); 149 effect->inputEffects().append(input1);
152 return effect.release(); 150 return effect.release();
153 } 151 }
154 152
155 } // namespace blink 153 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGFEOffsetElement.cpp ('k') | third_party/WebKit/Source/core/svg/SVGFETileElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698