haikuwebkit/LayoutTests/css3/filters/backdrop
Tim Horton 7ca53a0e84 Add a mechanism to dump the PlatformCALayer subtree of a GraphicsLayer, for testing
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
2021-04-15 23:32:04 +00:00
..
add-remove-add-backdrop-filter-expected.html
add-remove-add-backdrop-filter.html
animation-expected.txt
animation.html
backdrop-filter-does-not-size-properly-absolute-expected.txt
backdrop-filter-does-not-size-properly-absolute.html
backdrop-filter-does-not-size-properly-border-and-padding-expected.txt
backdrop-filter-does-not-size-properly-border-and-padding.html
backdrop-filter-uneven-corner-radii-expected.html
backdrop-filter-uneven-corner-radii.html
backdrop-filter-with-border-radius-and-reflection-add-expected.html
backdrop-filter-with-border-radius-and-reflection-add.html
backdrop-filter-with-border-radius-and-reflection-expected.html
backdrop-filter-with-border-radius-and-reflection-remove-expected.html
backdrop-filter-with-border-radius-and-reflection-remove.html
backdrop-filter-with-border-radius-and-reflection.html
backdrop-filter-with-border-radius-expected.html
backdrop-filter-with-border-radius-value-change-expected.html
backdrop-filter-with-border-radius-value-change.html
backdrop-filter-with-border-radius-value-remove-expected.html
backdrop-filter-with-border-radius-value-remove.html
backdrop-filter-with-border-radius.html
backdrop-filter-with-clip-path-expected.txt
backdrop-filter-with-clip-path.html
backdrop-filter-with-cliprect-expected.txt
backdrop-filter-with-cliprect.html
backdrop-filter-with-mask-expected.txt
backdrop-filter-with-mask.html
backdrop-filter-with-reflection-add-backdrop-expected.html
backdrop-filter-with-reflection-add-backdrop.html
backdrop-filter-with-reflection-expected.html
backdrop-filter-with-reflection-remove-backdrop-expected.html
backdrop-filter-with-reflection-remove-backdrop.html
backdrop-filter-with-reflection-value-change-expected.html
backdrop-filter-with-reflection-value-change.html
backdrop-filter-with-reflection.html
backdrop-with-visibility-hidden-2-expected.html
backdrop-with-visibility-hidden-2.html
backdrop-with-visibility-hidden-changing-expected.txt
backdrop-with-visibility-hidden-changing.html
backdrop-with-visibility-hidden-expected.txt
backdrop-with-visibility-hidden.html
backdropfilter-property-computed-style-expected.txt
backdropfilter-property-computed-style.html
backdropfilter-property-expected.txt
backdropfilter-property-parsing-expected.txt
backdropfilter-property-parsing-invalid-expected.txt
backdropfilter-property-parsing-invalid.html
backdropfilter-property-parsing.html
backdropfilter-property.html
blur-input-bounds.html
dynamic-backdrop-filter-change-expected.html
dynamic-backdrop-filter-change.html
dynamic-with-clip-path-expected.html
dynamic-with-clip-path.html
effect-hw-expected.html
effect-hw.html
layer-tree-as-text.js
resource-use-add-more-layers-expected.txt
resource-use-add-more-layers.html
resource-use-excessive-expected.txt
resource-use-excessive.html
resource-use-ok-expected.txt
resource-use-ok.html
resource-use-remove-some-layers-expected.txt
resource-use-remove-some-layers.html
resource-use.css