[webkit-changes] [WebKit/WebKit] 7754d9: [UnifiedPDF] Text jiggles between the low-res page...

Simon Fraser noreply at github.com
Sat May 4 08:52:50 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7754d9bf5ef54b9c4c58bdace2e3cd25da11df2c
      https://github.com/WebKit/WebKit/commit/7754d9bf5ef54b9c4c58bdace2e3cd25da11df2c
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2024-05-04 (Sat, 04 May 2024)

  Changed paths:
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.mm

  Log Message:
  -----------
  [UnifiedPDF] Text jiggles between the low-res page snapshots and high-resolution tiles
https://bugs.webkit.org/show_bug.cgi?id=273727
rdar://127523619

Reviewed by Tim Horton.

Fix two issues that caused text and other content to not be perfectly aligned between
page previews and high-resolution tiles.

First, the scale are always non-integral, so there was some slight scaling of the
page preview buffers in `AsyncPDFRenderer::paintPagePreview()` since the image buffer size
is an expanded integral value, and when painting without a sourceRect, it scales the whole
buffer to fit the destination rect. We can use the same rect for source and destination
to avoid this.

Second, turn off CG font subpixel quantization and positioning, both of which can cause
glyphs to snap when drawing into the scaled-down context used for page previews.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.mm:
(WebKit::AsyncPDFRenderer::paintPDFPageIntoBuffer):
(WebKit::AsyncPDFRenderer::paintPagePreview):

Canonical link: https://commits.webkit.org/278378@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