[webkit-changes] [WebKit/WebKit] 463c4d: [Unified PDF] Document turns blank white, flashes ...

Simon Fraser noreply at github.com
Sat Feb 24 16:15:32 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 463c4d367dff65f9fdfda6ad0726d27c3a900f25
      https://github.com/WebKit/WebKit/commit/463c4d367dff65f9fdfda6ad0726d27c3a900f25
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2024-02-24 (Sat, 24 Feb 2024)

  Changed paths:
    M Source/WebCore/platform/graphics/TiledBacking.h
    M Source/WebCore/platform/graphics/ca/TileController.cpp
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.mm
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm

  Log Message:
  -----------
  [Unified PDF] Document turns blank white, flashes / flickers, while scrolling/zooming
https://bugs.webkit.org/show_bug.cgi?id=270042
rdar://123458964

Reviewed by Tim Horton.

With async tile rendering, we don't always have tiles to paint for a given rect, resulting
in flashing, e.g. when resizing the window or zooming.

Ameliorate this by generating a preview for each page, and painting this when we don't have
tiles. Currently we generate previews at 0.5x scale for a 1x page scale.

AsyncPDFRenderer takes care of generating page previews, using a new callback from the
TiledBacking client when page coverage changes. The page previews are generated on the
concurrent work queue. Unlike tiles, these page previews are not invalidate on configuration
changes (there's a FIXME to update them when PDF content changes).

* Source/WebCore/platform/graphics/TiledBacking.h:
* Source/WebCore/platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setCoverageRect):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.mm:
(WebKit::AsyncPDFRenderer::generatePreviewImageForPage):
(WebKit::AsyncPDFRenderer::removePreviewForPage):
(WebKit::AsyncPDFRenderer::paintPagePreviewOnWorkQueue):
(WebKit::AsyncPDFRenderer::previewImageForPage const):
(WebKit::AsyncPDFRenderer::coverageRectDidChange):
(WebKit::AsyncPDFRenderer::paintPDFPageIntoBuffer):
(WebKit::AsyncPDFRenderer::paintTilesForPage):
(WebKit::AsyncPDFRenderer::updateTilesForPaintingRect):
(WebKit::AsyncPDFRenderer::paintTilesForPaintingRect): Deleted.
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::paintPDFContent): drawingRect was unused. Move documentScale out of the loop. Rename pageBoundsInDocumentCoordinates.
(WebKit::UnifiedPDFPlugin::heightForPageAtIndex const): Rename.
(WebKit::UnifiedPDFPlugin::firstPageHeight const):
(WebKit::UnifiedPDFPlugin::layoutBoundsForPageAtIndex const):
(WebKit::UnifiedPDFPlugin::scrollToPDFDestination):
(WebKit::UnifiedPDFPlugin::heightForPage const): Deleted.

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