Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrupt tiles when scrolling and selecting text quickly. #23558

Merged

Conversation

mattwoodrow
Copy link
Contributor

@mattwoodrow mattwoodrow commented Jan 31, 2024

77e5bb3

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

b9c1e23

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ api-wpe
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ›  gtk
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@mattwoodrow mattwoodrow self-assigned this Jan 31, 2024
@mattwoodrow mattwoodrow added the Layout and Rendering For bugs with layout and rendering of Web pages. label Jan 31, 2024
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 31, 2024
@mattwoodrow mattwoodrow removed the merging-blocked Applied to prevent a change from being merged label Jan 31, 2024
@mattwoodrow mattwoodrow force-pushed the eng/volatile-copy-back-to-front branch from 4ed16d4 to b9c1e23 Compare January 31, 2024 07:34
@webkit-early-warning-system
Copy link
Collaborator

Starting EWS tests for b9c1e23. Live statuses available at the PR page, #23558

@mattwoodrow mattwoodrow added the merge-queue Applied to send a pull request to merge-queue label Jan 31, 2024
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-commit-queue webkit-commit-queue merged commit 77e5bb3 into WebKit:main Jan 31, 2024
@webkit-commit-queue
Copy link
Collaborator

Committed 273838@main (77e5bb3): https://commits.webkit.org/273838@main

Reviewed commits have been landed. Closing PR #23558 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Layout and Rendering For bugs with layout and rendering of Web pages.
Projects
None yet
5 participants