Changeset 117696 in webkit


Ignore:
Timestamp:
May 19, 2012 1:41:42 PM (12 years ago)
Author:
rwlbuis@webkit.org
Message:

Remove bbox caching from SVGPathElement
https://bugs.webkit.org/show_bug.cgi?id=86233

Reviewed by Nikolas Zimmermann.

Remove caching of path bounding box, since SVGLocatable::getBBox is not used much at all.
This saves 200k of memory for worldcup.svg on 64-bit machine.

  • svg/SVGPathElement.cpp:

(WebCore::SVGPathElement::SVGPathElement):
(WebCore::SVGPathElement::svgAttributeChanged):
(WebCore::SVGPathElement::pathSegListChanged):
(WebCore::SVGPathElement::getBBox):

  • svg/SVGPathElement.h:

(SVGPathElement):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r117695 r117696  
     12012-05-19  Rob Buis  <rbuis@rim.com>
     2
     3        Remove bbox caching from SVGPathElement
     4        https://bugs.webkit.org/show_bug.cgi?id=86233
     5
     6        Reviewed by Nikolas Zimmermann.
     7
     8        Remove caching of path bounding box, since SVGLocatable::getBBox is not used much at all.
     9        This saves 200k of memory for worldcup.svg on 64-bit machine.
     10
     11        * svg/SVGPathElement.cpp:
     12        (WebCore::SVGPathElement::SVGPathElement):
     13        (WebCore::SVGPathElement::svgAttributeChanged):
     14        (WebCore::SVGPathElement::pathSegListChanged):
     15        (WebCore::SVGPathElement::getBBox):
     16        * svg/SVGPathElement.h:
     17        (SVGPathElement):
     18
    1192012-05-19  Andy Estes  <aestes@apple.com>
    220
  • trunk/Source/WebCore/svg/SVGPathElement.cpp

    r117195 r117696  
    7777    , m_pathByteStream(SVGPathByteStream::create())
    7878    , m_pathSegList(PathSegUnalteredRole)
    79     , m_cachedBBoxRectIsValid(false)
    8079    , m_isAnimValObserved(false)
    8180{
     
    267266            buildSVGPathSegListFromByteStream(m_pathByteStream.get(), this, newList, UnalteredParsing);
    268267            m_pathSegList.value = newList;
    269             m_cachedBBoxRectIsValid = false;
    270268        }
    271269
     
    350348    invalidateSVGAttributes();
    351349   
    352     m_cachedBBoxRectIsValid = false;
    353 
    354350    RenderSVGPath* renderer = static_cast<RenderSVGPath*>(this->renderer());
    355351    if (!renderer)
     
    371367        return FloatRect();
    372368
    373     if (!m_cachedBBoxRectIsValid) {
    374         m_cachedBBoxRect = renderer->path().boundingRect();
    375         m_cachedBBoxRectIsValid = true;
    376     }
    377    
    378     return m_cachedBBoxRect;
     369    return renderer->path().boundingRect();
    379370}
    380371
  • trunk/Source/WebCore/svg/SVGPathElement.h

    r117195 r117696  
    132132    OwnPtr<SVGPathByteStream> m_pathByteStream;
    133133    mutable SVGSynchronizableAnimatedProperty<SVGPathSegList> m_pathSegList;
    134     FloatRect m_cachedBBoxRect;
    135     bool m_cachedBBoxRectIsValid;                       
    136134    bool m_isAnimValObserved;
    137135};
Note: See TracChangeset for help on using the changeset viewer.