Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 74f0ad1b6f48586b34a55482948f69c7596d0a34
https://github.com/WebKit/WebKit/commit/74f0ad1b6f48586b34a55482948f69c7596d0a34
Author: Simon Fraser <[email protected]>
Date: 2024-04-19 (Fri, 19 Apr 2024)
Changed paths:
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.h
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.mm
Log Message:
-----------
[UnifiedPDF] Unify the "partial" and "full" PDF tile code paths
https://bugs.webkit.org/show_bug.cgi?id=272945
rdar://126723009
Reviewed by Tim Horton.
AsyncPDFRenderer had separate code paths for partial and full tile updates,
with two places
where we called `m_paintingWorkQueue->dispatch(...)`. Remove the one in
`AsyncPDFRenderer::pdfContentChangedInRect()`,
calling `enqueueTilePaintIfNecessary()` instead.
`AsyncPDFRenderer::enqueueTilePaintIfNecessary()` now takes an optional
clipRect for partial updates.
We need to take care when there is already a paint for this tile in flight;
there's no guarantee that
it will finish before our new one, so we have just override it, taking care to
unite any partial updates.
The newly added PDFTileRenderIdentifier allows us to determine, when a tile
render completes, if it's the
most recent one.
Now that we have this tracking, we can also remove entries from
`m_currentValidTileRenders` as soon
as they are complete, rather than waiting until paint time, which was a poor
version of batching.
Also ensure that `paintTileOnWorkQueue()` always notifies the main thread, even
in the case of buffer
allocation failure, to avoid leaving entries in m_currentValidTileRenders.
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.h:
(WebKit::AsyncPDFRenderer::enqueueTilePaintIfNecessary):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.mm:
(WebKit::AsyncPDFRenderer::willRepaintTile):
(WebKit::AsyncPDFRenderer::willRemoveTile):
(WebKit::AsyncPDFRenderer::willRepaintAllTiles): Just call
clearRequestsAndCachedTiles().
(WebKit::AsyncPDFRenderer::clearRequestsAndCachedTiles):
(WebKit::AsyncPDFRenderer::enqueueTilePaintIfNecessary):
(WebKit::AsyncPDFRenderer::renderInfoForTile const):
(WebKit::AsyncPDFRenderer::enqueuePaintWithClip):
(WebKit::AsyncPDFRenderer::paintTileOnWorkQueue):
(WebKit::AsyncPDFRenderer::transferBufferToMainThread):
(WebKit::AsyncPDFRenderer::didCompleteTileRender):
(WebKit::AsyncPDFRenderer::paintTilesForPage):
(WebKit::AsyncPDFRenderer::pdfContentChangedInRect):
(WebKit::AsyncPDFRenderer::didCompleteNewTileRender): Deleted.
(WebKit::AsyncPDFRenderer::didCompleteTileUpdateRender): Deleted.
Canonical link: https://commits.webkit.org/277747@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes