https://bugs.webkit.org/show_bug.cgi?id=224595
Reviewed by Simon Fraser.
Source/WebCore:
Test: fast/harness/platform-layer-tree-as-text.html
Add internals.platformLayerTreeAsText(), which takes a (composited) Element
and returns the recursive PlatformCALayer tree under that element's backing
layer's primary layer.
This is intended to be used in a future patch in order to test a fix
that is only currently testable by observing the platform layer tree.
I've separated it from that patch in order to get the test rebaselining
out of the way in a behavior-neutral patch.
The motivation for a new method instead of a layerTreeAsText() flag
is this: if you make each GraphicsLayerCA dump its PlatformCALayers
(as a "show me the platform sublayers recursively" flag might do),
each GraphicsLayerCA also dumps its children's platform sublayers.
Thus the easiest way to get sane logging for testing is to target
the specific element you're interested in; thus, a new method.
* page/Frame.cpp:
(WebCore::Frame::layerTreeAsText const): Deleted.
* page/Frame.h:
Move layerTreeAsText to RenderLayerCompositor, where it probably belongs.
* page/Page.h: Fix a typo.
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::platformLayerTreeAsText const):
* platform/graphics/GraphicsLayerClient.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::purposeNameForInnerLayer const):
When dumping a PlatformCALayer, look up its purpose by checking which
layer member it is, instead of having it passed in. This way, we can
look it up even when we've reached this layer by crawling down the
PlatformCALayer tree.
(WebCore::GraphicsLayerCA::dumpInnerLayer const):
Clean up the PlatformCALayer dumping; make it multi-line and more
consistent with GraphicsLayer's dumping (a future patch will add more properties).
(WebCore::GraphicsLayerCA::dumpAdditionalProperties const):
Use dumpInnerLayer when dumping PlatformCALayers from a GraphicsLayer dump,
but with a bit set to disable dumping children, to maintain the exising output
and avoid each layer also dumping its children's platform layers, as mentioned above.
(WebCore::GraphicsLayerCA::platformLayerTreeAsText const):
(WebCore::dumpInnerLayer): Deleted.
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
Add a getter for the set of sublayers of a PlatformCALayerCocoa that
themselves have PlatformCALayers (thus the -forLogging; I didn't want
anybody to accidentally think that this gets *all* of the sublayers).
(WebCore::PlatformCALayerCocoa::sublayersForLogging):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingForLayerTreeAsTextDump):
Consolidate all of the pre-layer-tree-dumping setup work, so it can
be shared between layerTreeAsText and platformLayerTreeAsText.
(WebCore::RenderLayerCompositor::layerTreeAsText):
(WebCore::RenderLayerCompositor::platformLayerTreeAsText):
* rendering/RenderLayerCompositor.h:
* testing/Internals.cpp:
(WebCore::Internals::layerTreeAsText const):
Adopt the RenderLayerCompositor version of layerTreeAsText.
Don't bother doing layout, RenderLayerCompositor does it.
(WebCore::toPlatformLayerTreeFlags):
(WebCore::Internals::platformLayerTreeAsText const):
* testing/Internals.h:
* testing/Internals.idl:
Source/WebKit:
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
Add a getter for the PlatformCALayer sublayers of PlatformCALayerRemote; see the note on PlatformCALayerCocoa.
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::layerTreeAsText const):
Adopt the RenderLayerCompositor version of layerTreeAsText.
Source/WebKitLegacy/mac:
* WebView/WebFrame.mm:
(-[WebFrame _layerTreeAsText]):
Adopt the RenderLayerCompositor version of layerTreeAsText.
LayoutTests:
* fast/harness/platform-layer-tree-as-text-expected.txt: Added.
* fast/harness/platform-layer-tree-as-text.html: Added.
Add a test for the basic output of platformLayerTreeAsText().
* compositing/video/video-object-position-expected.txt:
* compositing/visible-rect/mask-layer-coverage-expected.txt:
* css3/filters/backdrop/backdrop-filter-does-not-size-properly-absolute-expected.txt:
* css3/filters/backdrop/backdrop-filter-does-not-size-properly-border-and-padding-expected.txt:
* css3/filters/backdrop/backdrop-filter-with-cliprect-expected.txt:
* css3/filters/backdrop/backdrop-filter-with-mask-expected.txt:
* css3/filters/backdrop/backdrop-with-visibility-hidden-changing-expected.txt:
* css3/filters/backdrop/backdrop-with-visibility-hidden-expected.txt:
* css3/filters/backdrop/resource-use-add-more-layers-expected.txt:
* css3/filters/backdrop/resource-use-excessive-expected.txt:
* css3/filters/backdrop/resource-use-ok-expected.txt:
* css3/filters/backdrop/resource-use-remove-some-layers-expected.txt:
* fullscreen/full-screen-layer-dump-expected.txt:
* platform/ios/compositing/reflections/direct-image-object-fit-reflected-expected.txt:
* platform/ios/compositing/video/video-object-position-expected.txt:
* platform/ios/compositing/visible-rect/mask-layer-coverage-expected.txt:
* platform/ios/css3/filters/backdrop/backdrop-filter-does-not-size-properly-absolute-expected.txt:
* platform/ios/css3/filters/backdrop/backdrop-filter-with-cliprect-expected.txt:
* platform/ios/css3/filters/backdrop/backdrop-filter-with-mask-expected.txt:
* platform/mac/compositing/images/direct-image-object-fit-expected.txt:
* platform/mac/compositing/reflections/direct-image-object-fit-reflected-expected.txt:
* platform/mac/compositing/video/video-object-fit-expected.txt:
Rebaseline some tests to the new logging format.
* platform/gtk/TestExpectations:
* platform/win/TestExpectations:
* platform/wpe/TestExpectations:
Skip the new test on non-Cocoa ports.
Canonical link: https://commits.webkit.org/236597@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276085 268f45cc-cd09-0410-ab3c-d52691b4dbfc