Title: [117696] trunk/Source/WebCore
- Revision
- 117696
- Author
- [email protected]
- Date
- 2012-05-19 13:41:42 -0700 (Sat, 19 May 2012)
Log 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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (117695 => 117696)
--- trunk/Source/WebCore/ChangeLog 2012-05-19 19:29:36 UTC (rev 117695)
+++ trunk/Source/WebCore/ChangeLog 2012-05-19 20:41:42 UTC (rev 117696)
@@ -1,3 +1,21 @@
+2012-05-19 Rob Buis <[email protected]>
+
+ 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):
+
2012-05-19 Andy Estes <[email protected]>
Fix build errors found when disabling ENABLE_DRAG_SUPPORT
Modified: trunk/Source/WebCore/svg/SVGPathElement.cpp (117695 => 117696)
--- trunk/Source/WebCore/svg/SVGPathElement.cpp 2012-05-19 19:29:36 UTC (rev 117695)
+++ trunk/Source/WebCore/svg/SVGPathElement.cpp 2012-05-19 20:41:42 UTC (rev 117696)
@@ -76,7 +76,6 @@
: SVGStyledTransformableElement(tagName, document)
, m_pathByteStream(SVGPathByteStream::create())
, m_pathSegList(PathSegUnalteredRole)
- , m_cachedBBoxRectIsValid(false)
, m_isAnimValObserved(false)
{
ASSERT(hasTagName(SVGNames::pathTag));
@@ -266,7 +265,6 @@
SVGPathSegList newList(PathSegUnalteredRole);
buildSVGPathSegListFromByteStream(m_pathByteStream.get(), this, newList, UnalteredParsing);
m_pathSegList.value = newList;
- m_cachedBBoxRectIsValid = false;
}
if (renderer)
@@ -349,8 +347,6 @@
invalidateSVGAttributes();
- m_cachedBBoxRectIsValid = false;
-
RenderSVGPath* renderer = static_cast<RenderSVGPath*>(this->renderer());
if (!renderer)
return;
@@ -370,12 +366,7 @@
if (!renderer)
return FloatRect();
- if (!m_cachedBBoxRectIsValid) {
- m_cachedBBoxRect = renderer->path().boundingRect();
- m_cachedBBoxRectIsValid = true;
- }
-
- return m_cachedBBoxRect;
+ return renderer->path().boundingRect();
}
RenderObject* SVGPathElement::createRenderer(RenderArena* arena, RenderStyle*)
Modified: trunk/Source/WebCore/svg/SVGPathElement.h (117695 => 117696)
--- trunk/Source/WebCore/svg/SVGPathElement.h 2012-05-19 19:29:36 UTC (rev 117695)
+++ trunk/Source/WebCore/svg/SVGPathElement.h 2012-05-19 20:41:42 UTC (rev 117696)
@@ -131,8 +131,6 @@
private:
OwnPtr<SVGPathByteStream> m_pathByteStream;
mutable SVGSynchronizableAnimatedProperty<SVGPathSegList> m_pathSegList;
- FloatRect m_cachedBBoxRect;
- bool m_cachedBBoxRectIsValid;
bool m_isAnimValObserved;
};
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes