[webkit-changes] [WebKit/WebKit] e4d8e9: visionOS: Pixel cracks within layers at some conte...

Tim Horton noreply at github.com
Mon Sep 18 16:20:38 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e4d8e9236f2add93fa83d8c13b8401df421155aa
      https://github.com/WebKit/WebKit/commit/e4d8e9236f2add93fa83d8c13b8401df421155aa
  Author: Tim Horton <thorton at apple.com>
  Date:   2023-09-18 (Mon, 18 Sep 2023)

  Changed paths:
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm

  Log Message:
  -----------
  visionOS: Pixel cracks within layers at some content scales
https://bugs.webkit.org/show_bug.cgi?id=261693
rdar://108139596

Reviewed by Dean Jackson.

* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::setNeedsDisplay):
(WebKit::RemoteLayerBackingStore::layerBounds const):
(WebKit::RemoteLayerBackingStore::drawInContext):
Dynamic content scaling doesn't support partial repaint, so we disable it.

We do this by calling setNeedsDisplay() on the layer, intending to make a
single repaint rect covering the whole layer.

However, RemoteLayerBackingStore's setNeedDisplay doesn't intersect incoming repaint
rects with the layer's bounds, so a very large repaint rect *outside* of the bounds
of the layer (like you might get with e.g. a large negative text-indent, which is
fairly common on the web), results in a m_dirtyRegion with rectangles far outside
the layer.

Then, depending on the shape of the extralayer repaint rects, the logic in
RemoteLayerBackingStore::drawInContext that decides whether or not to do a
partial repaint (based on the delta between the area covered by the repaint rects
and the bounds of a full repaint) can still decide to do a partial repaint.
(Despite the fact that we absolutely cannot perform partial repaints
for dynamic content scaling right now).

Fix this by intersecting incoming repaint rects with the layer's bounds, so that
calling setNeedsDisplay *always* results in RemoteLayerBackingStore::drawInContext
doing a full repaint.

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




More information about the webkit-changes mailing list