Title: [103245] trunk/Source/WebCore
- Revision
- 103245
- Author
- kl...@webkit.org
- Date
- 2011-12-19 10:11:20 -0800 (Mon, 19 Dec 2011)
Log Message
Avoid instantiating ScrollAnimators when possible.
<http://webkit.org/b/74830>
Reviewed by Beth Dakin.
Have RenderLayer::scrollToOffset() check if we're scrolling to the already
current offset. In that case, don't call down to scrollToOffsetWithoutAnimation(),
avoiding the instantiation of a ScrollAnimator.
This reduces memory consumption by 400 kB (on 32-bit) when viewing the full HTML5
spec on <http://whatwg.org/c>, since we were creating a ScrollAnimator for every
single RenderLayer.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollToOffset):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (103244 => 103245)
--- trunk/Source/WebCore/ChangeLog 2011-12-19 18:07:40 UTC (rev 103244)
+++ trunk/Source/WebCore/ChangeLog 2011-12-19 18:11:20 UTC (rev 103245)
@@ -1,3 +1,21 @@
+2011-12-19 Andreas Kling <kl...@webkit.org>
+
+ Avoid instantiating ScrollAnimators when possible.
+ <http://webkit.org/b/74830>
+
+ Reviewed by Beth Dakin.
+
+ Have RenderLayer::scrollToOffset() check if we're scrolling to the already
+ current offset. In that case, don't call down to scrollToOffsetWithoutAnimation(),
+ avoiding the instantiation of a ScrollAnimator.
+
+ This reduces memory consumption by 400 kB (on 32-bit) when viewing the full HTML5
+ spec on <http://whatwg.org/c>, since we were creating a ScrollAnimator for every
+ single RenderLayer.
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::scrollToOffset):
+
2011-12-19 Chris Guan <chris.g...@torchmobile.com.cn>
[BlackBerry] remove one file related to multipart from the BlackBerry build system
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (103244 => 103245)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2011-12-19 18:07:40 UTC (rev 103244)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2011-12-19 18:11:20 UTC (rev 103245)
@@ -1412,8 +1412,10 @@
x = min(max<LayoutUnit>(x, 0), maxX);
y = min(max<LayoutUnit>(y, 0), maxY);
}
-
- ScrollableArea::scrollToOffsetWithoutAnimation(LayoutPoint(x, y));
+
+ LayoutPoint newScrollOffset(x, y);
+ if (newScrollOffset != LayoutPoint(scrollXOffset(), scrollYOffset()))
+ scrollToOffsetWithoutAnimation(newScrollOffset);
}
void RenderLayer::scrollTo(int x, int y)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes