Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 77e5bb39107371558f6ee94cf74b988d3231ab41
      
https://github.com/WebKit/WebKit/commit/77e5bb39107371558f6ee94cf74b988d3231ab41
  Author: Matt Woodrow <mattwood...@apple.com>
  Date:   2024-01-31 (Wed, 31 Jan 2024)

  Changed paths:
    A 
LayoutTests/compositing/repaint/needs-no-display-volatile-repaint-expected.html
    A LayoutTests/compositing/repaint/needs-no-display-volatile-repaint.html
    M Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp

  Log Message:
  -----------
  Corrupt tiles when scrolling and selecting text quickly.
https://bugs.webkit.org/show_bug.cgi?id=268430
<rdar://121934201>

Reviewed by Simon Fraser.

If ensureBufferForDisplay returns 
SwapBuffersDisplayRequirement::NeedsNoDisplay, then we don't want
to call prepareForDisplay. The latter copies pixels from the old front buffer 
into the new one,
and when no display is required there wasn't a front/back swap, so no copy 
needed.

This caused issues because we also set 'm_previouslyPaintedRect` to the 
(empty!) dirty area,
effectively recording that the front and back buffers were identical, despite 
it likely
not being true. The next attempt to paint these buffers would omit a 
back-to-front copy,
thinking the buffers were identical, and then we'd do a partial update on top 
of stale content.

This happens when scrolling, since scrolling tiles get pooled (and made 
volatile), then
recycled.

* 
LayoutTests/compositing/repaint/needs-no-display-volatile-repaint-expected.html:
 Added.
* LayoutTests/compositing/repaint/needs-no-display-volatile-repaint.html: Added.
* Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::prepareImageBufferSetsForDisplay):
(WebKit::RemoteRenderingBackend::prepareImageBufferSetsForDisplaySync):

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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to