[webkit-changes] [WebKit/WebKit] 3f543a: Reuse InteractionRegion layers when an element is ...

Etienne Segonzac noreply at github.com
Wed Aug 16 07:58:52 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3f543a9ea04e09fdfe995130a78dbbd7a86b4450
      https://github.com/WebKit/WebKit/commit/3f543a9ea04e09fdfe995130a78dbbd7a86b4450
  Author: Etienne Segonzac <sgz at apple.com>
  Date:   2023-08-16 (Wed, 16 Aug 2023)

  Changed paths:
    M LayoutTests/interaction-region/interaction-layers-culling-expected.txt
    M LayoutTests/interaction-region/layer-tree-expected.txt
    M LayoutTests/interaction-region/layer-tree.html
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeInteractionRegionLayers.mm

  Log Message:
  -----------
  Reuse InteractionRegion layers when an element is resized
https://bugs.webkit.org/show_bug.cgi?id=260078
<rdar://112930285>

Reviewed by Tim Horton and Mike Wyrzykowski.

We currently only reuse InteractionRegions layers based on their frame.
This patch adds the ability to reuse layers when an element is resized
or moved.

* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeInteractionRegionLayers.mm:
(WebKit::setInteractionRegion): Deleted.
(WebKit::setInteractionRegionOcclusion): Deleted.
(WebKit::setInteractionRegionGuard): Deleted.
(WebKit::createInteractionRegionLayer):
Extract the layer creation code in a single function for readability.
(WebKit::configureRemoteEffect):
Extract the remote effect configuration in a function for readibility.
(WebKit::applyBackgroundColorForDebuggingToLayer):
Extract the debug layer configuration to a function for readability.
(WebKit::interactionRegionTypeForLayer):
(WebKit::interactionRegionGroupNameForRegion):
(WebKit::interactionRegionGroupNameForLayer):
(WebKit::isAnyInteractionRegionLayer):
Style fix. Re-order functions.

(WebKit::updateLayersForInteractionRegions):
Keep track of existing layers that are not part of a multi-layer
group effect for reuse.
Move the layer reuse / creation code to a lambda to use early returns
and improve readability. Add the new `groupName` based reuse code path.
Clarify the conditions under which we update properties on the
InteractionRegion layer.

* LayoutTests/interaction-region/layer-tree.html:
Make sure all branches of the `updateLayersForInteractionRegions()` get
exercised during the test.
* LayoutTests/interaction-region/interaction-layers-culling-expected.txt:
* LayoutTests/interaction-region/layer-tree-expected.txt:
Reset and update test expectations (something changed below us).

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




More information about the webkit-changes mailing list