Avoid a recursive descendants layer walk sometimes
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 May 2019 05:41:08 +0000 (05:41 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 May 2019 05:41:08 +0000 (05:41 +0000)
commitbd57678e537fba2931e5694b75d42de328dee367
treeddf6ce68d8d3dbc5effc009f2e246a99a2f0ffef
parent6e0817f32bfbc6eff0b8db77e25d2146a2801f42
Avoid a recursive descendants layer walk sometimes
https://bugs.webkit.org/show_bug.cgi?id=197939

Reviewed by Zalan Bujtas.

If a layer got composited post-descendants because it needs to clip, for example, we'd do a recursive
descendant tree walk to add layers to the overlap map. However, all the descendants would already
have contributed to the overlap map if some non-root ancestor was already composited. So we can
skip the addDescendantsToOverlapMapRecursive() if we know, before descendants, whether there's
a non-root composited ancestor.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::CompositingState::hasNonRootCompositedAncestor const):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):

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