[webkit-changes] [WebKit/WebKit] 47a585: Out-of-view InteractionRegion layers should be culled

Etienne Segonzac noreply at github.com
Mon Jul 17 11:37:54 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 47a5853ddf044928125a26ae03723bb675780aa1
      https://github.com/WebKit/WebKit/commit/47a5853ddf044928125a26ae03723bb675780aa1
  Author: Etienne Segonzac <sgz at apple.com>
  Date:   2023-07-17 (Mon, 17 Jul 2023)

  Changed paths:
    A LayoutTests/interaction-region/interaction-layers-culling-expected.txt
    A LayoutTests/interaction-region/interaction-layers-culling.html
    M Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
    M Source/WebCore/platform/graphics/ca/PlatformCALayer.h
    M Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h
    M Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTree.serialization.in
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeInteractionRegionLayers.h
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeInteractionRegionLayers.mm
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h
    M Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h
    M Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.mm

  Log Message:
  -----------
  Out-of-view InteractionRegion layers should be culled
https://bugs.webkit.org/show_bug.cgi?id=259142
rdar://111595133

Reviewed by Simon Fraser.

Set the computed coverage rect on UI-side layers and use it to cull
InteractionRegion layers.

* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateCoverage):
* Source/WebCore/platform/graphics/ca/PlatformCALayer.h:
* Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::setCoverageRect):
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTree.serialization.in:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
(WebKit::dumpChangedLayers):
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.mm:
(WebKit::PlatformCALayerRemote::setCoverageRect):
Propagate the coverage rect to the UI-side layer.

* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyProperties):
Call `updateLayersForInteractionRegions` when either the EventRegion or
the CoverageRect changes.
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
(WebKit::RemoteLayerTreeNode::coverageRect const):
(WebKit::RemoteLayerTreeNode::setCoverageRect):
Store the coverage rect on the RemoteLayerTreeNode alongside the
event region.

* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeInteractionRegionLayers.h:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeInteractionRegionLayers.mm:
(WebKit::updateLayersForInteractionRegions):
If the node has a known coverage rect, only add InteractionRegion layers
that intersect with it.

* LayoutTests/interaction-region/interaction-layers-culling-expected.txt: Added.
* LayoutTests/interaction-region/interaction-layers-culling.html: Added.
Add new test to cover culling.

Canonical link: https://commits.webkit.org/266105@main




More information about the webkit-changes mailing list