Commit 181ee388 authored by reni@webkit.org's avatar reni@webkit.org

FEMorphologyElement changes doesn't require relayout

https://bugs.webkit.org/show_bug.cgi?id=55462

Reviewed by Andreas Kling.

When the FEMorphologyElement receives an update message but the given value remains the same we don't need
to relayout the filter.

No new tests are needed because this modification is covered by the dynamic update tests of FEMorphology.

* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::setMorphologyOperator):
(WebCore::FEMorphology::setRadiusX):
(WebCore::FEMorphology::setRadiusY):
* platform/graphics/filters/FEMorphology.h:
* svg/SVGFEMorphologyElement.cpp:
(WebCore::SVGFEMorphologyElement::setFilterEffectAttribute):
(WebCore::SVGFEMorphologyElement::svgAttributeChanged):
* svg/SVGFEMorphologyElement.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a1eea816
2011-03-02 Renata Hodovan <reni@webkit.org>
Reviewed by Andreas Kling.
FEMorphologyElement changes doesn't require relayout
https://bugs.webkit.org/show_bug.cgi?id=55462
When the FEMorphologyElement receives an update message but the given value remains the same we don't need
to relayout the filter.
No new tests are needed because this modification is covered by the dynamic update tests of FEMorphology.
* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::setMorphologyOperator):
(WebCore::FEMorphology::setRadiusX):
(WebCore::FEMorphology::setRadiusY):
* platform/graphics/filters/FEMorphology.h:
* svg/SVGFEMorphologyElement.cpp:
(WebCore::SVGFEMorphologyElement::setFilterEffectAttribute):
(WebCore::SVGFEMorphologyElement::svgAttributeChanged):
* svg/SVGFEMorphologyElement.h:
2011-03-01 Kent Tamura <tkent@chromium.org>
Reviewed by Dimitri Glazkov.
......
......@@ -56,9 +56,12 @@ MorphologyOperatorType FEMorphology::morphologyOperator() const
return m_type;
}
void FEMorphology::setMorphologyOperator(MorphologyOperatorType type)
bool FEMorphology::setMorphologyOperator(MorphologyOperatorType type)
{
if (m_type == type)
return false;
m_type = type;
return true;
}
float FEMorphology::radiusX() const
......@@ -66,9 +69,12 @@ float FEMorphology::radiusX() const
return m_radiusX;
}
void FEMorphology::setRadiusX(float radiusX)
bool FEMorphology::setRadiusX(float radiusX)
{
if (m_radiusX == radiusX)
return false;
m_radiusX = radiusX;
return true;
}
float FEMorphology::radiusY() const
......@@ -86,9 +92,12 @@ void FEMorphology::determineAbsolutePaintRect()
setAbsolutePaintRect(enclosingIntRect(paintRect));
}
void FEMorphology::setRadiusY(float radiusY)
bool FEMorphology::setRadiusY(float radiusY)
{
if (m_radiusY == radiusY)
return false;
m_radiusY = radiusY;
return true;
}
void FEMorphology::apply()
......
......@@ -38,13 +38,13 @@ class FEMorphology : public FilterEffect {
public:
static PassRefPtr<FEMorphology> create(Filter*, MorphologyOperatorType, float radiusX, float radiusY);
MorphologyOperatorType morphologyOperator() const;
void setMorphologyOperator(MorphologyOperatorType);
bool setMorphologyOperator(MorphologyOperatorType);
float radiusX() const;
void setRadiusX(float);
bool setRadiusX(float);
float radiusY() const;
void setRadiusY(float);
bool setRadiusY(float);
virtual void apply();
virtual void dump();
......
......@@ -86,13 +86,27 @@ void SVGFEMorphologyElement::parseMappedAttribute(Attribute* attr)
SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
}
bool SVGFEMorphologyElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName)
{
FEMorphology* morphology = static_cast<FEMorphology*>(effect);
if (attrName == SVGNames::operatorAttr)
return morphology->setMorphologyOperator(static_cast<MorphologyOperatorType>(_operator()));
if (attrName == SVGNames::radiusAttr)
return (morphology->setRadiusX(radiusX()) || morphology->setRadiusY(radiusY()));
ASSERT_NOT_REACHED();
return false;
}
void SVGFEMorphologyElement::svgAttributeChanged(const QualifiedName& attrName)
{
SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
if (attrName == SVGNames::inAttr
|| attrName == SVGNames::operatorAttr
if (attrName == SVGNames::operatorAttr
|| attrName == SVGNames::radiusAttr)
primitiveAttributeChanged(attrName);
if (attrName == SVGNames::inAttr)
invalidate();
}
......
......@@ -38,6 +38,7 @@ private:
SVGFEMorphologyElement(const QualifiedName&, Document*);
virtual void parseMappedAttribute(Attribute*);
virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
virtual void svgAttributeChanged(const QualifiedName&);
virtual void synchronizeProperty(const QualifiedName&);
virtual void fillAttributeToPropertyTypeMap();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment