Changeset 79856 in webkit


Ignore:
Timestamp:
Feb 28, 2011 6:03:06 AM (13 years ago)
Author:
reni@webkit.org
Message:

2011-02-28 Renata Hodovan <reni@webkit.org>

Reviewed by Andreas Kling.

FECompositeElement changes doesn't require relayout.
https://bugs.webkit.org/show_bug.cgi?id=55367

When the FECompositeElement 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 FEComposite.

  • platform/graphics/filters/FEComposite.cpp: (WebCore::FEComposite::setOperation): (WebCore::FEComposite::setK1): (WebCore::FEComposite::setK2): (WebCore::FEComposite::setK3): (WebCore::FEComposite::setK4):
  • platform/graphics/filters/FEComposite.h:
  • svg/SVGFECompositeElement.cpp: (WebCore::SVGFECompositeElement::setFilterEffectAttribute): (WebCore::SVGFECompositeElement::svgAttributeChanged):
  • svg/SVGFECompositeElement.h:
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r79855 r79856  
     12011-02-28  Renata Hodovan  <reni@webkit.org>
     2
     3        Reviewed by Andreas Kling.
     4
     5        FECompositeElement changes doesn't require relayout.
     6        https://bugs.webkit.org/show_bug.cgi?id=55367
     7
     8        When the FECompositeElement receives an update message but the given value remains the same we don't need
     9        to relayout the filter.
     10
     11        No new tests are needed because this modification is covered by the dynamic update tests of FEComposite.
     12
     13        * platform/graphics/filters/FEComposite.cpp:
     14        (WebCore::FEComposite::setOperation):
     15        (WebCore::FEComposite::setK1):
     16        (WebCore::FEComposite::setK2):
     17        (WebCore::FEComposite::setK3):
     18        (WebCore::FEComposite::setK4):
     19        * platform/graphics/filters/FEComposite.h:
     20        * svg/SVGFECompositeElement.cpp:
     21        (WebCore::SVGFECompositeElement::setFilterEffectAttribute):
     22        (WebCore::SVGFECompositeElement::svgAttributeChanged):
     23        * svg/SVGFECompositeElement.h:
     24
    1252011-02-28  Andreas Kling  <kling@webkit.org>
    226
  • trunk/Source/WebCore/platform/graphics/filters/FEComposite.cpp

    r75377 r79856  
    5656}
    5757
    58 void FEComposite::setOperation(CompositeOperationType type)
    59 {
     58bool FEComposite::setOperation(CompositeOperationType type)
     59{
     60    if (m_type == type)
     61        return false;
    6062    m_type = type;
     63    return true;
    6164}
    6265
     
    6669}
    6770
    68 void FEComposite::setK1(float k1)
    69 {
     71bool FEComposite::setK1(float k1)
     72{
     73    if (m_k1 == k1)
     74        return false;
    7075    m_k1 = k1;
     76    return true;
    7177}
    7278
     
    7682}
    7783
    78 void FEComposite::setK2(float k2)
    79 {
     84bool FEComposite::setK2(float k2)
     85{
     86    if (m_k2 == k2)
     87        return false;
    8088    m_k2 = k2;
     89    return true;
    8190}
    8291
     
    8695}
    8796
    88 void FEComposite::setK3(float k3)
    89 {
     97bool FEComposite::setK3(float k3)
     98{
     99    if (m_k3 == k3)
     100        return false;
    90101    m_k3 = k3;
     102    return true;
    91103}
    92104
     
    96108}
    97109
    98 void FEComposite::setK4(float k4)
    99 {
     110bool FEComposite::setK4(float k4)
     111{
     112    if (m_k4 == k4)
     113        return false;
    100114    m_k4 = k4;
     115    return true;
    101116}
    102117
  • trunk/Source/WebCore/platform/graphics/filters/FEComposite.h

    r72474 r79856  
    4646
    4747    CompositeOperationType operation() const;
    48     void setOperation(CompositeOperationType);
     48    bool setOperation(CompositeOperationType);
    4949
    5050    float k1() const;
    51     void setK1(float);
     51    bool setK1(float);
    5252
    5353    float k2() const;
    54     void setK2(float);
     54    bool setK2(float);
    5555
    5656    float k3() const;
    57     void setK3(float);
     57    bool setK3(float);
    5858
    5959    float k4() const;
    60     void setK4(float);
     60    bool setK4(float);
    6161
    6262    virtual void apply();
  • trunk/Source/WebCore/svg/SVGFECompositeElement.cpp

    r78345 r79856  
    8383}
    8484
     85bool SVGFECompositeElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName)
     86{
     87    FEComposite* composite = static_cast<FEComposite*>(effect);
     88    if (attrName == SVGNames::operatorAttr)
     89        return composite->setOperation(static_cast<CompositeOperationType>(_operator()));
     90    if (attrName == SVGNames::k1Attr)
     91        return composite->setK1(k1());
     92    if (attrName == SVGNames::k2Attr)
     93        return composite->setK2(k2());
     94    if (attrName == SVGNames::k3Attr)
     95        return composite->setK3(k3());
     96    if (attrName == SVGNames::k4Attr)
     97        return composite->setK4(k4());
     98
     99    ASSERT_NOT_REACHED();
     100    return false;
     101}
     102
     103
    85104void SVGFECompositeElement::svgAttributeChanged(const QualifiedName& attrName)
    86105{
    87106    SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
    88107
    89     if (attrName == SVGNames::inAttr
    90         || attrName == SVGNames::in2Attr
    91         || attrName == SVGNames::operatorAttr
     108    if (attrName == SVGNames::operatorAttr
    92109        || attrName == SVGNames::k1Attr
    93110        || attrName == SVGNames::k2Attr
    94111        || attrName == SVGNames::k3Attr
    95112        || attrName == SVGNames::k4Attr)
     113        primitiveAttributeChanged(attrName);
     114
     115    if (attrName == SVGNames::inAttr
     116        || attrName == SVGNames::in2Attr)
    96117        invalidate();
    97118}
  • trunk/Source/WebCore/svg/SVGFECompositeElement.h

    r78249 r79856  
    3838
    3939    virtual void parseMappedAttribute(Attribute*);
     40    virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
    4041    virtual void svgAttributeChanged(const QualifiedName&);
    4142    virtual void synchronizeProperty(const QualifiedName&);
Note: See TracChangeset for help on using the changeset viewer.