[webkit-changes] [WebKit/WebKit] d56a44: [iOS] Print preview should use images instead of PDFs

Richard Robinson noreply at github.com
Tue Feb 21 18:06:33 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d56a44cbd116ed60bde26f13beaf33969327feb6
      https://github.com/WebKit/WebKit/commit/d56a44cbd116ed60bde26f13beaf33969327feb6
  Author: Richard Robinson <richard_robinson2 at apple.com>
  Date:   2023-02-21 (Tue, 21 Feb 2023)

  Changed paths:
    M Source/WebKit/Platform/spi/ios/UIKitSPI.h
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/_WKWebViewPrintFormatter.mm
    M Source/WebKit/UIProcess/_WKWebViewPrintFormatterInternal.h
    M Source/WebKit/UIProcess/ios/WKContentView.mm
    M Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKit/WebProcess/WebPage/WebPage.messages.in
    M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

  Log Message:
  -----------
  [iOS] Print preview should use images instead of PDFs
https://bugs.webkit.org/show_bug.cgi?id=220815
rdar://65129050

Reviewed by Aditya Keerthi.

When generating the print preview, the system will now use an image-backed preview
instead of a PDF-backed one for better performance, if a responsive print rendering
quality was requested. The logic added is analogous with how the PDF generation works.

* Source/WebKit/Platform/spi/ios/UIKitSPI.h:
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/_WKWebViewPrintFormatter.h:
* Source/WebKit/UIProcess/_WKWebViewPrintFormatter.mm:
(-[_WKWebViewPrintFormatter _shouldUseResponsivePrintRendering]):
(-[_WKWebViewPrintFormatter _printPreviewImage]):
(-[_WKWebViewPrintFormatter _setPrintPreviewImage:]):
(-[_WKWebViewPrintFormatter _waitForPrintedDocumentOrImage]):
(-[_WKWebViewPrintFormatter _invalidatePrintRenderingState]):
(-[_WKWebViewPrintFormatter _recalcPageCount]):
(-[_WKWebViewPrintFormatter drawInRect:forPageAtIndex:]):
(-[_WKWebViewPrintFormatter _drawInRectUsingBitmap:forPageAtIndex:]):
(-[_WKWebViewPrintFormatter _drawInRectUsingPDF:forPageAtIndex:]):
(-[_WKWebViewPrintFormatter _waitForPrintedDocument]): Deleted.
* Source/WebKit/UIProcess/_WKWebViewPrintFormatterInternal.h:
* Source/WebKit/UIProcess/ios/WKContentView.mm:
(-[_WKPrintFormattingAttributes initWithPageCount:frameID:printInfo:]):
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
(-[WKContentView _resetPrintRenderingState]):
(-[WKContentView _resetPrintingState]):
(-[WKContentView _attributesForPrintFormatter:]):
(-[WKContentView _wk_pageCountForPrintFormatter:]):
(-[WKContentView _createImage:isPrintingOnBackgroundThread:printFormatter:]):
(-[WKContentView _createPDF:isPrintingOnBackgroundThread:printFormatter:]):
(-[WKContentView _waitForDrawToPDFCallbackForPrintFormatterIfNeeded:]):
(-[WKContentView _wk_requestDocumentForPrintFormatter:]):
(-[WKContentView _waitForDrawToImageCallbackForPrintFormatterIfNeeded:]):
(-[WKContentView _wk_requestImageForPrintFormatter:]):
(-[WKContentView _wk_supportsRenderingBitmap]):
* Source/WebKit/UIProcess/ios/WKPDFView.mm:
(-[WKPDFView _wk_supportsRenderingBitmap]):
* Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::drawToImage):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::drawPagesToPDFImpl):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::drawToImage):

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




More information about the webkit-changes mailing list