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

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

Issue 1378163003: Use initial values for flood/lighting-color/flood-opacity when detached 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
« no previous file with comments | « no previous file | third_party/WebKit/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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 primitiveAttributeChanged(attrName); 119 primitiveAttributeChanged(attrName);
120 } 120 }
121 121
122 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilte rBuilder* filterBuilder, Filter* filter) 122 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilte rBuilder* filterBuilder, Filter* filter)
123 { 123 {
124 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr entValue()->value())); 124 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr entValue()->value()));
125 125
126 if (!input1) 126 if (!input1)
127 return nullptr; 127 return nullptr;
128 128
129 LayoutObject* layoutObject = this->layoutObject(); 129 Color color = Color::white;
130 if (!layoutObject) 130 if (LayoutObject* layoutObject = this->layoutObject()) {
131 return nullptr; 131 ASSERT(layoutObject->style());
132 132 color = layoutObject->styleRef().svgStyle().lightingColor();
133 ASSERT(layoutObject->style()); 133 }
134 Color color = layoutObject->style()->svgStyle().lightingColor();
135 134
136 const SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*th is); 135 const SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*th is);
137 RefPtr<LightSource> lightSource = lightNode ? lightNode->lightSource(filter) : nullptr; 136 RefPtr<LightSource> lightSource = lightNode ? lightNode->lightSource(filter) : nullptr;
138 137
139 RefPtrWillBeRawPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, 138 RefPtrWillBeRawPtr<FilterEffect> effect = FEDiffuseLighting::create(filter,
140 color, 139 color,
141 m_surfaceScale->currentValue()->value(), 140 m_surfaceScale->currentValue()->value(),
142 m_diffuseConstant->currentValue()->value(), 141 m_diffuseConstant->currentValue()->value(),
143 lightSource.release()); 142 lightSource.release());
144 effect->inputEffects().append(input1); 143 effect->inputEffects().append(input1);
145 return effect.release(); 144 return effect.release();
146 } 145 }
147 146
148 } // namespace blink 147 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/svg/SVGFEDropShadowElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698