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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGFEDropShadowElement.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) Research In Motion Limited 2011. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 if (!layoutObject) 80 if (!layoutObject)
81 return nullptr; 81 return nullptr;
82 82
83 ASSERT(layoutObject->style()); 83 ASSERT(layoutObject->style());
84 const SVGComputedStyle& svgStyle = layoutObject->style()->svgStyle(); 84 const SVGComputedStyle& svgStyle = layoutObject->style()->svgStyle();
85 85
86 Color color = svgStyle.floodColor(); 86 Color color = svgStyle.floodColor();
87 float opacity = svgStyle.floodOpacity(); 87 float opacity = svgStyle.floodOpacity();
88 88
89 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr entValue()->value())); 89 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr entValue()->value()));
90 if (!input1) 90 ASSERT(input1);
91 return nullptr;
92 91
93 // Clamp std.dev. to non-negative. (See SVGFEGaussianBlurElement::build) 92 // Clamp std.dev. to non-negative. (See SVGFEGaussianBlurElement::build)
94 float stdDevX = std::max(0.0f, stdDeviationX()->currentValue()->value()); 93 float stdDevX = std::max(0.0f, stdDeviationX()->currentValue()->value());
95 float stdDevY = std::max(0.0f, stdDeviationY()->currentValue()->value()); 94 float stdDevY = std::max(0.0f, stdDeviationY()->currentValue()->value());
96 RefPtrWillBeRawPtr<FilterEffect> effect = FEDropShadow::create(filter, stdDe vX, stdDevY, m_dx->currentValue()->value(), m_dy->currentValue()->value(), color , opacity); 95 RefPtrWillBeRawPtr<FilterEffect> effect = FEDropShadow::create(filter, stdDe vX, stdDevY, m_dx->currentValue()->value(), m_dy->currentValue()->value(), color , opacity);
97 effect->inputEffects().append(input1); 96 effect->inputEffects().append(input1);
98 return effect.release(); 97 return effect.release();
99 } 98 }
100 99
101 } // namespace blink 100 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698