[webkit-changes] [WebKit/WebKit] f5f474: [UnifiedPDF] Use a tiled layer for rendering

Tim Horton noreply at github.com
Thu Nov 9 19:35:05 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f5f4745165e83c9db5289ecdf1705a6cc499057c
      https://github.com/WebKit/WebKit/commit/f5f4745165e83c9db5289ecdf1705a6cc499057c
  Author: Tim Horton <thorton at apple.com>
  Date:   2023-11-09 (Thu, 09 Nov 2023)

  Changed paths:
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDocumentLayout.mm
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm

  Log Message:
  -----------
  [UnifiedPDF] Use a tiled layer for rendering
https://bugs.webkit.org/show_bug.cgi?id=264539
rdar://114831923

Reviewed by Simon Fraser.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDocumentLayout.mm:
(WebKit::PDFDocumentLayout::documentMargin):
(WebKit::PDFDocumentLayout::pageMargin):
Adjust margins to match PDFExtensionViewController (the PDFLayerController
numbers are similar but confusingly nonintegral, and that seems nonideal).

(WebKit::PDFDocumentLayout::layoutSingleColumn):
(WebKit::PDFDocumentLayout::layoutTwoUpColumn):
m_documentBounds is in document space (below the scaling), so use the unscaled
width here.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::updateLayerHierarchy):
Make a tiled layer.

(WebKit::UnifiedPDFPlugin::notifyFlushRequired):
(WebKit::UnifiedPDFPlugin::didChangeIsInWindow):
Implement some tiled layer dependencies.

(WebKit::UnifiedPDFPlugin::paintContents):
Use the document size instead of view size in various places, fixing rendering once you scroll.
Also, paint the background color into the layer.

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




More information about the webkit-changes mailing list