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

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

Issue 2738863002: Replace ASSERT with DCHECK in core/svg/ (Closed)
Patch Set: Split DCHECKS wherever possible Created 3 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
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); 95 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
96 } 96 }
97 97
98 FilterEffect* SVGFEDropShadowElement::build(SVGFilterBuilder* filterBuilder, 98 FilterEffect* SVGFEDropShadowElement::build(SVGFilterBuilder* filterBuilder,
99 Filter* filter) { 99 Filter* filter) {
100 LayoutObject* layoutObject = this->layoutObject(); 100 LayoutObject* layoutObject = this->layoutObject();
101 if (!layoutObject) 101 if (!layoutObject)
102 return nullptr; 102 return nullptr;
103 103
104 ASSERT(layoutObject->style()); 104 DCHECK(layoutObject->style());
105 const SVGComputedStyle& svgStyle = layoutObject->style()->svgStyle(); 105 const SVGComputedStyle& svgStyle = layoutObject->style()->svgStyle();
106 106
107 Color color = svgStyle.floodColor(); 107 Color color = svgStyle.floodColor();
108 float opacity = svgStyle.floodOpacity(); 108 float opacity = svgStyle.floodOpacity();
109 109
110 FilterEffect* input1 = filterBuilder->getEffectById( 110 FilterEffect* input1 = filterBuilder->getEffectById(
111 AtomicString(m_in1->currentValue()->value())); 111 AtomicString(m_in1->currentValue()->value()));
112 ASSERT(input1); 112 DCHECK(input1);
113 113
114 // Clamp std.dev. to non-negative. (See SVGFEGaussianBlurElement::build) 114 // Clamp std.dev. to non-negative. (See SVGFEGaussianBlurElement::build)
115 float stdDevX = std::max(0.0f, stdDeviationX()->currentValue()->value()); 115 float stdDevX = std::max(0.0f, stdDeviationX()->currentValue()->value());
116 float stdDevY = std::max(0.0f, stdDeviationY()->currentValue()->value()); 116 float stdDevY = std::max(0.0f, stdDeviationY()->currentValue()->value());
117 FilterEffect* effect = FEDropShadow::create( 117 FilterEffect* effect = FEDropShadow::create(
118 filter, stdDevX, stdDevY, m_dx->currentValue()->value(), 118 filter, stdDevX, stdDevY, m_dx->currentValue()->value(),
119 m_dy->currentValue()->value(), color, opacity); 119 m_dy->currentValue()->value(), color, opacity);
120 effect->inputEffects().push_back(input1); 120 effect->inputEffects().push_back(input1);
121 return effect; 121 return effect;
122 } 122 }
123 123
124 } // namespace blink 124 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698