Changeset 79851 in webkit
- Timestamp:
- Feb 28, 2011 3:31:11 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r79850 r79851 1 2011-02-28 Renata Hodovan <reni@webkit.org> 2 3 Reviewed by Andreas Kling. 4 5 FETurbulenceElement changes doesn't require relayout 6 https://bugs.webkit.org/show_bug.cgi?id=55141 7 8 When the FETurbulenceElement receives an update message but the given value remains the same we don't need 9 to relayout the filter. 10 Besides fix a typo in FETurbulence and change the paramterer type of FETurbulence::setNumOctaves from bool 11 to int according to the spec. 12 13 No new tests are needed because this modification is covered by the dynamic update tests of FETurbulence. 14 15 * platform/graphics/filters/FETurbulence.cpp: 16 (WebCore::FETurbulence::FETurbulence): 17 (WebCore::FETurbulence::create): 18 (WebCore::FETurbulence::type): 19 (WebCore::FETurbulence::setType): 20 (WebCore::FETurbulence::setBaseFrequencyY): 21 (WebCore::FETurbulence::setBaseFrequencyX): 22 (WebCore::FETurbulence::setSeed): 23 (WebCore::FETurbulence::setNumOctaves): 24 (WebCore::FETurbulence::setStitchTiles): 25 (WebCore::operator<<): 26 * platform/graphics/filters/FETurbulence.h: 27 * svg/SVGFETurbulenceElement.cpp: 28 (WebCore::SVGFETurbulenceElement::setFilterEffectAttribute): 29 (WebCore::SVGFETurbulenceElement::svgAttributeChanged): 30 (WebCore::SVGFETurbulenceElement::build): 31 * svg/SVGFETurbulenceElement.h: 32 1 33 2011-02-28 Pavel Feldman <pfeldman@chromium.org> 2 34 -
trunk/Source/WebCore/platform/graphics/filters/FETurbulence.cpp
r75377 r79851 50 50 static const int s_randR = 2836; // m % a 51 51 52 FETurbulence::FETurbulence(Filter* filter, Turbul anceType type, float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed, bool stitchTiles)52 FETurbulence::FETurbulence(Filter* filter, TurbulenceType type, float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed, bool stitchTiles) 53 53 : FilterEffect(filter) 54 54 , m_type(type) … … 61 61 } 62 62 63 PassRefPtr<FETurbulence> FETurbulence::create(Filter* filter, Turbul anceType type, float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed, bool stitchTiles)63 PassRefPtr<FETurbulence> FETurbulence::create(Filter* filter, TurbulenceType type, float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed, bool stitchTiles) 64 64 { 65 65 return adoptRef(new FETurbulence(filter, type, baseFrequencyX, baseFrequencyY, numOctaves, seed, stitchTiles)); 66 66 } 67 67 68 Turbul anceType FETurbulence::type() const68 TurbulenceType FETurbulence::type() const 69 69 { 70 70 return m_type; 71 71 } 72 72 73 void FETurbulence::setType(TurbulanceType type) 74 { 73 bool FETurbulence::setType(TurbulenceType type) 74 { 75 if (m_type == type) 76 return false; 75 77 m_type = type; 78 return true; 76 79 } 77 80 … … 81 84 } 82 85 83 void FETurbulence::setBaseFrequencyY(float baseFrequencyY) 84 { 86 bool FETurbulence::setBaseFrequencyY(float baseFrequencyY) 87 { 88 if (m_baseFrequencyY == baseFrequencyY) 89 return false; 85 90 m_baseFrequencyY = baseFrequencyY; 91 return true; 86 92 } 87 93 … … 91 97 } 92 98 93 void FETurbulence::setBaseFrequencyX(float baseFrequencyX) 94 { 95 m_baseFrequencyX = baseFrequencyX; 99 bool FETurbulence::setBaseFrequencyX(float baseFrequencyX) 100 { 101 if (m_baseFrequencyX == baseFrequencyX) 102 return false; 103 m_baseFrequencyX = baseFrequencyX; 104 return true; 96 105 } 97 106 … … 101 110 } 102 111 103 void FETurbulence::setSeed(float seed) 104 { 112 bool FETurbulence::setSeed(float seed) 113 { 114 if (m_seed == seed) 115 return false; 105 116 m_seed = seed; 117 return true; 106 118 } 107 119 … … 111 123 } 112 124 113 void FETurbulence::setNumOctaves(bool numOctaves) 114 { 125 bool FETurbulence::setNumOctaves(int numOctaves) 126 { 127 if (m_numOctaves == numOctaves) 128 return false; 115 129 m_numOctaves = numOctaves; 130 return true; 116 131 } 117 132 … … 121 136 } 122 137 123 void FETurbulence::setStitchTiles(bool stitch) 124 { 138 bool FETurbulence::setStitchTiles(bool stitch) 139 { 140 if (m_stitchTiles == stitch) 141 return false; 125 142 m_stitchTiles = stitch; 143 return true; 126 144 } 127 145 … … 354 372 } 355 373 356 static TextStream& operator<<(TextStream& ts, const Turbul anceType& type)374 static TextStream& operator<<(TextStream& ts, const TurbulenceType& type) 357 375 { 358 376 switch (type) { -
trunk/Source/WebCore/platform/graphics/filters/FETurbulence.h
r72474 r79851 31 31 namespace WebCore { 32 32 33 enum Turbul anceType {33 enum TurbulenceType { 34 34 FETURBULENCE_TYPE_UNKNOWN = 0, 35 35 FETURBULENCE_TYPE_FRACTALNOISE = 1, … … 39 39 class FETurbulence : public FilterEffect { 40 40 public: 41 static PassRefPtr<FETurbulence> create(Filter*, Turbul anceType, float, float, int, float, bool);41 static PassRefPtr<FETurbulence> create(Filter*, TurbulenceType, float, float, int, float, bool); 42 42 43 Turbul anceType type() const;44 void setType(TurbulanceType);43 TurbulenceType type() const; 44 bool setType(TurbulenceType); 45 45 46 46 float baseFrequencyY() const; 47 voidsetBaseFrequencyY(float);47 bool setBaseFrequencyY(float); 48 48 49 49 float baseFrequencyX() const; 50 voidsetBaseFrequencyX(float);50 bool setBaseFrequencyX(float); 51 51 52 52 float seed() const; 53 voidsetSeed(float);53 bool setSeed(float); 54 54 55 55 int numOctaves() const; 56 void setNumOctaves(bool);56 bool setNumOctaves(int); 57 57 58 58 bool stitchTiles() const; 59 voidsetStitchTiles(bool);59 bool setStitchTiles(bool); 60 60 61 61 virtual void apply(); … … 85 85 }; 86 86 87 FETurbulence(Filter*, Turbul anceType, float, float, int, float, bool);87 FETurbulence(Filter*, TurbulenceType, float, float, int, float, bool); 88 88 89 89 inline void initPaint(PaintingData&); … … 91 91 unsigned char calculateTurbulenceValueForPoint(PaintingData&, const FloatPoint&); 92 92 93 Turbul anceType m_type;93 TurbulenceType m_type; 94 94 float m_baseFrequencyX; 95 95 float m_baseFrequencyY; -
trunk/Source/WebCore/svg/SVGFETurbulenceElement.cpp
r78345 r79851 90 90 } 91 91 92 bool SVGFETurbulenceElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) 93 { 94 FETurbulence* turbulence = static_cast<FETurbulence*>(effect); 95 if (attrName == SVGNames::typeAttr) 96 return turbulence->setType(static_cast<TurbulenceType>(type())); 97 if (attrName == SVGNames::stitchTilesAttr) 98 return turbulence->setStitchTiles(stitchTiles()); 99 if (attrName == SVGNames::baseFrequencyAttr) 100 return (turbulence->setBaseFrequencyX(baseFrequencyX()) || turbulence->setBaseFrequencyY(baseFrequencyY())); 101 if (attrName == SVGNames::seedAttr) 102 return turbulence->setSeed(seed()); 103 if (attrName == SVGNames::numOctavesAttr) 104 return turbulence->setNumOctaves(numOctaves()); 105 106 ASSERT_NOT_REACHED(); 107 return false; 108 } 109 92 110 void SVGFETurbulenceElement::svgAttributeChanged(const QualifiedName& attrName) 93 111 { 94 112 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); 95 113 96 114 if (attrName == SVGNames::baseFrequencyAttr 97 115 || attrName == SVGNames::numOctavesAttr … … 99 117 || attrName == SVGNames::stitchTilesAttr 100 118 || attrName == SVGNames::typeAttr) 101 invalidate();119 primitiveAttributeChanged(attrName); 102 120 } 103 121 … … 152 170 return 0; 153 171 154 return FETurbulence::create(filter, static_cast<Turbul anceType>(type()), baseFrequencyX(),172 return FETurbulence::create(filter, static_cast<TurbulenceType>(type()), baseFrequencyX(), 155 173 baseFrequencyY(), numOctaves(), seed(), stitchTiles() == SVG_STITCHTYPE_STITCH); 156 174 } -
trunk/Source/WebCore/svg/SVGFETurbulenceElement.h
r78249 r79851 45 45 46 46 virtual void parseMappedAttribute(Attribute*); 47 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName); 47 48 virtual void svgAttributeChanged(const QualifiedName&); 48 49 virtual void synchronizeProperty(const QualifiedName&);
Note: See TracChangeset
for help on using the changeset viewer.