Skip to content

Conversation

@smfr
Copy link
Contributor

@smfr smfr commented May 8, 2024

5ab3ad6

[UnfiedPDF] Flicker of low-resolution content when toggling a checkbox
https://bugs.webkit.org/show_bug.cgi?id=273912
rdar://127773717

Reviewed by Abrar Rahman Protyasha.

The fine-grained tile invalidation added in 277837@main adds a check on the "contentVersion",
which increments whenever an annotation, like a checkbox, changes state. This caused us to
throw away rendered tiles in `AsyncPDFRenderer::willRepaintTile()`, which resulted in a flash
of the blurry page background until we got the new tile.

It's OK to paint tiles with a stale contentVersion; we'll paint the new state once we've got
a rendered tile with the new content.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.h:
(WebKit::AsyncPDFRenderer::TileRenderInfo::equivalentForPaintingIgnoringContentVersion const):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.mm:
(WebKit::AsyncPDFRenderer::renderInfoIsValidForTile const):
(WebKit::AsyncPDFRenderer::willRepaintTile):
(WebKit::AsyncPDFRenderer::didCompleteTileRender):

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

7c72dfb

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 ✅ 🛠 wpe-skia
🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 tv ✅ 🧪 mac-AS-debug-wk2 🧪 gtk-wk2
✅ 🛠 tv-sim ✅ 🧪 mac-wk2-stress 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🛠 watch
✅ 🛠 watch-sim

@smfr smfr requested a review from cdumez as a code owner May 8, 2024 23:46
@smfr smfr self-assigned this May 8, 2024
@smfr smfr added the PDF For bugs in WebKit's built-in PDF support. label May 8, 2024
@smfr smfr added the merge-queue Applied to send a pull request to merge-queue label May 9, 2024
https://bugs.webkit.org/show_bug.cgi?id=273912
rdar://127773717

Reviewed by Abrar Rahman Protyasha.

The fine-grained tile invalidation added in 277837@main adds a check on the "contentVersion",
which increments whenever an annotation, like a checkbox, changes state. This caused us to
throw away rendered tiles in `AsyncPDFRenderer::willRepaintTile()`, which resulted in a flash
of the blurry page background until we got the new tile.

It's OK to paint tiles with a stale contentVersion; we'll paint the new state once we've got
a rendered tile with the new content.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.h:
(WebKit::AsyncPDFRenderer::TileRenderInfo::equivalentForPaintingIgnoringContentVersion const):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.mm:
(WebKit::AsyncPDFRenderer::renderInfoIsValidForTile const):
(WebKit::AsyncPDFRenderer::willRepaintTile):
(WebKit::AsyncPDFRenderer::didCompleteTileRender):

Canonical link: https://commits.webkit.org/278544@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/UnfiedPDF-Flicker-of-low-resolution-content-when-toggling-a-checkbox branch from 7c72dfb to 5ab3ad6 Compare May 9, 2024 01:48
@webkit-commit-queue
Copy link
Collaborator

Committed 278544@main (5ab3ad6): https://commits.webkit.org/278544@main

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

@webkit-commit-queue webkit-commit-queue merged commit 5ab3ad6 into WebKit:main May 9, 2024
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label May 9, 2024
@smfr smfr deleted the eng/UnfiedPDF-Flicker-of-low-resolution-content-when-toggling-a-checkbox branch May 9, 2024 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PDF For bugs in WebKit's built-in PDF support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants