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

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

Issue 2436793002: Simplify SVGAnimated* initialization (Closed)
Patch Set: Created 4 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 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 16 matching lines...) Expand all
27 namespace blink { 27 namespace blink {
28 28
29 inline SVGFEGaussianBlurElement::SVGFEGaussianBlurElement(Document& document) 29 inline SVGFEGaussianBlurElement::SVGFEGaussianBlurElement(Document& document)
30 : SVGFilterPrimitiveStandardAttributes(SVGNames::feGaussianBlurTag, 30 : SVGFilterPrimitiveStandardAttributes(SVGNames::feGaussianBlurTag,
31 document), 31 document),
32 m_stdDeviation( 32 m_stdDeviation(
33 SVGAnimatedNumberOptionalNumber::create(this, 33 SVGAnimatedNumberOptionalNumber::create(this,
34 SVGNames::stdDeviationAttr, 34 SVGNames::stdDeviationAttr,
35 0, 35 0,
36 0)), 36 0)),
37 m_in1(SVGAnimatedString::create(this, 37 m_in1(SVGAnimatedString::create(this, SVGNames::inAttr)) {
38 SVGNames::inAttr,
39 SVGString::create())) {
40 addToPropertyMap(m_stdDeviation); 38 addToPropertyMap(m_stdDeviation);
41 addToPropertyMap(m_in1); 39 addToPropertyMap(m_in1);
42 } 40 }
43 41
44 DEFINE_TRACE(SVGFEGaussianBlurElement) { 42 DEFINE_TRACE(SVGFEGaussianBlurElement) {
45 visitor->trace(m_stdDeviation); 43 visitor->trace(m_stdDeviation);
46 visitor->trace(m_in1); 44 visitor->trace(m_in1);
47 SVGFilterPrimitiveStandardAttributes::trace(visitor); 45 SVGFilterPrimitiveStandardAttributes::trace(visitor);
48 } 46 }
49 47
(...skipping 28 matching lines...) Expand all
78 // 76 //
79 // => Clamp to non-negative. 77 // => Clamp to non-negative.
80 float stdDevX = std::max(0.0f, stdDeviationX()->currentValue()->value()); 78 float stdDevX = std::max(0.0f, stdDeviationX()->currentValue()->value());
81 float stdDevY = std::max(0.0f, stdDeviationY()->currentValue()->value()); 79 float stdDevY = std::max(0.0f, stdDeviationY()->currentValue()->value());
82 FilterEffect* effect = FEGaussianBlur::create(filter, stdDevX, stdDevY); 80 FilterEffect* effect = FEGaussianBlur::create(filter, stdDevX, stdDevY);
83 effect->inputEffects().append(input1); 81 effect->inputEffects().append(input1);
84 return effect; 82 return effect;
85 } 83 }
86 84
87 } // namespace blink 85 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698