[webkit-changes] [WebKit/WebKit] d02b4b: [UnifiedPDF] Make it possible to host GraphicsLaye...

Simon Fraser noreply at github.com
Fri Oct 6 19:39:57 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d02b4b36c7de77a71b82f8f39cf80e4c5fbf6c3d
      https://github.com/WebKit/WebKit/commit/d02b4b36c7de77a71b82f8f39cf80e4c5fbf6c3d
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2023-10-06 (Fri, 06 Oct 2023)

  Changed paths:
    M Source/WebCore/plugins/PluginViewBase.h
    M Source/WebCore/rendering/RenderEmbeddedObject.cpp
    M Source/WebCore/rendering/RenderLayerBacking.cpp
    M Source/WebCore/rendering/RenderLayerBacking.h
    M Source/WebCore/rendering/RenderLayerCompositor.cpp
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm
    M Source/WebKit/WebProcess/Plugins/PluginView.cpp
    M Source/WebKit/WebProcess/Plugins/PluginView.h

  Log Message:
  -----------
  [UnifiedPDF] Make it possible to host GraphicsLayers exposed for a plug-in
https://bugs.webkit.org/show_bug.cgi?id=262819
rdar://116601287

Reviewed by Tim Horton.

The UnifiedPDF plug-in will internally contain a GraphicsLayer hierarchy, and we need to connect
this with page GraphicsLayers. So have `PluginViewBase` expose a `PluginLayerHostingStrategy`, so
that clients can choose to access either the `platformLayer()` or the `graphicsLayer()`. Similarly,
have `PDFPluginBase` mirror this, and implement as appropriate in PDFPlugin and UnifiedPDFPlugin.

RenderLayerBacking currently expects clients to use of of the "setContents" functions when
a replaced object has layer contents, but now we need to parent a GraphicsLayer. We do this
in `RenderLayerCompositor::updateBackingAndHierarchy()`. This is preliminary; later changes will
ensure that we get the geometry, clipping etc correct.

* Source/WebCore/plugins/PluginViewBase.h:
(WebCore::PluginViewBase::layerHostingStrategy const):
(WebCore::PluginViewBase::platformLayer const):
(WebCore::PluginViewBase::graphicsLayer const):
* Source/WebCore/rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::allowsAcceleratedCompositing const):
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::layerForContents const):
* Source/WebCore/rendering/RenderLayerBacking.h:
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::platformLayer const):
(WebKit::PDFPlugin::pluginLayer): Deleted.
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h:
(WebKit::PDFPluginBase::platformLayer const):
(WebKit::PDFPluginBase::graphicsLayer const):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::teardown):
(WebKit::UnifiedPDFPlugin::graphicsLayer const):
(WebKit::UnifiedPDFPlugin::installPDFDocument):
(WebKit::UnifiedPDFPlugin::createGraphicsLayer):
(WebKit::UnifiedPDFPlugin::udpateLayerHierarchy):
(WebKit::UnifiedPDFPlugin::paintContents):
(WebKit::UnifiedPDFPlugin::paint): Deleted.
* Source/WebKit/WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::layerHostingStrategy const):
(WebKit::PluginView::platformLayer const):
(WebKit::PluginView::graphicsLayer const):
* Source/WebKit/WebProcess/Plugins/PluginView.h:

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




More information about the webkit-changes mailing list