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

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

Issue 1375793003: Update error-handling for fe*Lighting and feTurbulence (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 * 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 74
75 DEFINE_NODE_FACTORY(SVGFETurbulenceElement) 75 DEFINE_NODE_FACTORY(SVGFETurbulenceElement)
76 76
77 bool SVGFETurbulenceElement::setFilterEffectAttribute(FilterEffect* effect, cons t QualifiedName& attrName) 77 bool SVGFETurbulenceElement::setFilterEffectAttribute(FilterEffect* effect, cons t QualifiedName& attrName)
78 { 78 {
79 FETurbulence* turbulence = static_cast<FETurbulence*>(effect); 79 FETurbulence* turbulence = static_cast<FETurbulence*>(effect);
80 if (attrName == SVGNames::typeAttr) 80 if (attrName == SVGNames::typeAttr)
81 return turbulence->setType(m_type->currentValue()->enumValue()); 81 return turbulence->setType(m_type->currentValue()->enumValue());
82 if (attrName == SVGNames::stitchTilesAttr) 82 if (attrName == SVGNames::stitchTilesAttr)
83 return turbulence->setStitchTiles(m_stitchTiles->currentValue()->enumVal ue()); 83 return turbulence->setStitchTiles(m_stitchTiles->currentValue()->enumVal ue() == SVG_STITCHTYPE_STITCH);
84 if (attrName == SVGNames::baseFrequencyAttr) { 84 if (attrName == SVGNames::baseFrequencyAttr) {
85 bool baseFrequencyXChanged = turbulence->setBaseFrequencyX(baseFrequency X()->currentValue()->value()); 85 bool baseFrequencyXChanged = turbulence->setBaseFrequencyX(baseFrequency X()->currentValue()->value());
86 bool baseFrequencyYChanged = turbulence->setBaseFrequencyY(baseFrequency Y()->currentValue()->value()); 86 bool baseFrequencyYChanged = turbulence->setBaseFrequencyY(baseFrequency Y()->currentValue()->value());
87 return (baseFrequencyXChanged || baseFrequencyYChanged); 87 return (baseFrequencyXChanged || baseFrequencyYChanged);
88 } 88 }
89 if (attrName == SVGNames::seedAttr) 89 if (attrName == SVGNames::seedAttr)
90 return turbulence->setSeed(m_seed->currentValue()->value()); 90 return turbulence->setSeed(m_seed->currentValue()->value());
91 if (attrName == SVGNames::numOctavesAttr) 91 if (attrName == SVGNames::numOctavesAttr)
92 return turbulence->setNumOctaves(m_numOctaves->currentValue()->value()); 92 return turbulence->setNumOctaves(m_numOctaves->currentValue()->value());
93 93
(...skipping 11 matching lines...) Expand all
105 SVGElement::InvalidationGuard invalidationGuard(this); 105 SVGElement::InvalidationGuard invalidationGuard(this);
106 primitiveAttributeChanged(attrName); 106 primitiveAttributeChanged(attrName);
107 return; 107 return;
108 } 108 }
109 109
110 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); 110 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
111 } 111 }
112 112
113 PassRefPtrWillBeRawPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuil der*, Filter* filter) 113 PassRefPtrWillBeRawPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuil der*, Filter* filter)
114 { 114 {
115 if (baseFrequencyX()->currentValue()->value() < 0 || baseFrequencyY()->curre ntValue()->value() < 0) 115 return FETurbulence::create(filter,
116 return nullptr; 116 m_type->currentValue()->enumValue(),
117 return FETurbulence::create(filter, m_type->currentValue()->enumValue(), bas eFrequencyX()->currentValue()->value(), baseFrequencyY()->currentValue()->value( ), m_numOctaves->currentValue()->value(), m_seed->currentValue()->value(), m_sti tchTiles->currentValue()->enumValue() == SVG_STITCHTYPE_STITCH); 117 baseFrequencyX()->currentValue()->value(),
118 baseFrequencyY()->currentValue()->value(),
119 m_numOctaves->currentValue()->value(),
120 m_seed->currentValue()->value(),
121 m_stitchTiles->currentValue()->enumValue() == SVG_STITCHTYPE_STITCH);
118 } 122 }
119 123
120 } // namespace blink 124 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698