[webkit-changes] [WebKit/WebKit] ac4612: UnifiedPDF: Page previews are rendered with incorr...
Kimmo Kinnunen
noreply at github.com
Tue Dec 17 05:47:23 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ac461272a92e0d61c043918dfb3fc3378fd0d788
https://github.com/WebKit/WebKit/commit/ac461272a92e0d61c043918dfb3fc3378fd0d788
Author: Kimmo Kinnunen <kkinnunen at apple.com>
Date: 2024-12-17 (Tue, 17 Dec 2024)
Changed paths:
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.mm
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDiscretePresentationController.mm
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFPresentationController.h
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFPresentationController.mm
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFScrollingPresentationController.mm
Log Message:
-----------
UnifiedPDF: Page previews are rendered with incorrect scale
https://bugs.webkit.org/show_bug.cgi?id=284616
rdar://141424286
Reviewed by Simon Fraser and Abrar Rahman Protyasha.
The cached page previews bitmaps would be rendered with scale 1,
even thougdh the preview layers have content scale of
0.5 * deviceScale * document layout scale.
The code tried to use the custom scale of the graphics layer, but
AsyncPDFRenderer receives invalidation calls with contents layer as the
GraphicsLayer parameter, and asking custom scale from that is
meaningless. The background layer is the one that responds to
the custom scale query.
Fix by resolving the page preview scale by asking from the presentation
controller. Conceptually the AsyncPDFRenderer is oblivious of page
preview layers at the moment. All page preview communication goes via
the presenation controller, and thus it's at the moment consistent to
ask the preview scale from the controller too.
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.mm:
(WebKit::AsyncPDFRenderer::coverageRectDidChange):
(WebKit::AsyncPDFRenderer::paintPagePreview):
(WebKit::AsyncPDFRenderer::pdfContentChangedInRect):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDiscretePresentationController.mm:
(WebKit::PDFDiscretePresentationController::customContentsScale const):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFPresentationController.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFPresentationController.mm:
(WebKit::PDFPresentationController::scaleForPagePreviews const):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFScrollingPresentationController.mm:
(WebKit::PDFScrollingPresentationController::customContentsScale const):
Canonical link: https://commits.webkit.org/287937@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list