[webkit-changes] [WebKit/WebKit] 375292: UnifiedPDF: GPU process exceeds memory limits when...
Tim Horton
noreply at github.com
Thu Feb 20 16:50:40 PST 2025
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 375292ba272410294300c0310c27e7b5841c58e1
https://github.com/WebKit/WebKit/commit/375292ba272410294300c0310c27e7b5841c58e1
Author: Tim Horton <thorton at apple.com>
Date: 2025-02-20 (Thu, 20 Feb 2025)
Changed paths:
M Source/WTF/wtf/PlatformEnableCocoa.h
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.h
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFScrollingPresentationController.mm
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm
Log Message:
-----------
UnifiedPDF: GPU process exceeds memory limits when zooming
https://bugs.webkit.org/show_bug.cgi?id=287478
rdar://144608457
Reviewed by Wenson Hsieh and Aditya Keerthi.
Mark the PDF layers as needing native contexts, so that they get
in process layer backing store.
Fixes cases where GPU process would exceed its memory limits because
CA would create temporary images for draws, and the temporary images
would not be attributed to the WebContent process.
The PDF images are rendered in WCP, and in theory there
is no benefit in transferring the data to GPUP for blitting
to a layer tile. GPU process transfer neccessitates a memcpy of the data.
The blit to a layer tile should be a memcpy. Thus keeping the data in
WCP should be optimal. However, due to inefficiency of the
PDF paint code, WCP will do a lot more work than a single memcpy. It
appears that the general case perf is still comparable to the
transfer to GPUP.
Also, disable the selection layers entirely instead of moving them to the Web
Content process, because they are not used on iOS and are simply waste.
Original patch credit goes to Kimmo Kinnunen. This updated patch limits
the behavior change to iOS family (by Abrar) and to remove more layers.
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFPresentationController.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFPresentationController.mm:
(WebKit::PDFPresentationController::makePageContainerLayer):
(WebKit::PDFPresentationController::shouldAccelerateContentsDrawing const):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFScrollingPresentationController.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFScrollingPresentationController.mm:
(WebKit::PDFScrollingPresentationController::setupLayers):
(WebKit::PDFScrollingPresentationController::layerNeedsPlatformContext const):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::updateOverflowControlsLayers):
(WebKit::UnifiedPDFPlugin::positionOverflowControlsLayers):
(WebKit::UnifiedPDFPlugin::shouldAccelerateContentsDrawing const):
(WebKit::UnifiedPDFPlugin::layerNeedsPlatformContext const):
Canonical link: https://commits.webkit.org/290757@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