Avoid calling calculateLayerBounds() and convertToLayerCoords() more than once per...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Nov 2012 05:24:49 +0000 (05:24 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Nov 2012 05:24:49 +0000 (05:24 +0000)
commitb4fae5a80f5fe42e672d8b5e9d44c9570a65ea25
treef2cca724f6c5aae50862b150de7d51f3db39662f
parent0436a550c9f5c4f42c2bae301568b034da5fba00
Avoid calling calculateLayerBounds() and convertToLayerCoords() more than once per layer paint
https://bugs.webkit.org/show_bug.cgi?id=102031

Reviewed by Beth Dakin.

RenderLayer::paintLayerContents() and callees could end up calling convertToLayerCoords()
and calculateLayerBounds() multiple times for painting a single layer.

Keep track of whether we've computed the root-relative bounds and do it on demand.
Compute the offset relative to rootLayer once, and pass it around as an optional parameter
to functions that need it.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::hitTestLayer):
(WebCore::RenderLayer::calculateRects):
(WebCore::RenderLayer::intersectsDamageRect):
(WebCore::RenderLayer::boundingBox):
(WebCore::RenderLayer::calculateLayerBounds):
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::calculateCompositedBounds):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@134356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerCompositor.cpp