[Fullscreen] Do not create composited layers for renderers unless they are part of...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Jul 2018 04:02:05 +0000 (04:02 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Jul 2018 04:02:05 +0000 (04:02 +0000)
commitdda659ebe296f8734f9324667382bc8d4babd56b
tree55ce89191fb6b013fe5559d6e4d7e2a8449b9271
parent39155402d87e52b8536cb87cab260009047441ed
[Fullscreen] Do not create composited layers for renderers unless they are part of the fullscreen subtree.
https://bugs.webkit.org/show_bug.cgi?id=188087
<rdar://problem/42632124>

Reviewed by Simon Fraser.

Source/WebCore:

Sibling composited layers prevent battery lifetime optimizations when in fullscreen.

Test: compositing/no-compositing-when-fulll-screen-is-present.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::isDescendantOf const):
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::isDescendantOfFullScreenLayer):
(WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
(WebCore::RenderLayerCompositor::requiresCompositingForPosition const):

LayoutTests:

* compositing/no-compositing-when-fulll-screen-is-present-expected.txt: Added.
* compositing/no-compositing-when-fulll-screen-is-present.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/compositing/no-compositing-when-fulll-screen-is-present-expected.txt [new file with mode: 0644]
LayoutTests/compositing/no-compositing-when-fulll-screen-is-present.html [new file with mode: 0644]
LayoutTests/platform/ios/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerCompositor.cpp