[webkit-changes] [WebKit/WebKit] dc5a42: GraphicsLayerWC: site isolation support

Fujii Hironori noreply at github.com
Mon Jun 12 20:15:08 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: dc5a423def84441a34100343e210d96406307e04
      https://github.com/WebKit/WebKit/commit/dc5a423def84441a34100343e210d96406307e04
  Author: Fujii Hironori <Hironori.Fujii at sony.com>
  Date:   2023-06-12 (Mon, 12 Jun 2023)

  Changed paths:
    M Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
    M Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp
    M Source/WebKit/GPUProcess/graphics/wc/RemoteWCLayerTreeHost.cpp
    M Source/WebKit/GPUProcess/graphics/wc/RemoteWCLayerTreeHost.h
    A Source/WebKit/GPUProcess/graphics/wc/WCRemoteFrameHostLayerManager.cpp
    A Source/WebKit/GPUProcess/graphics/wc/WCRemoteFrameHostLayerManager.h
    M Source/WebKit/GPUProcess/graphics/wc/WCScene.cpp
    M Source/WebKit/PlatformPlayStation.cmake
    M Source/WebKit/PlatformWin.cmake
    M Source/WebKit/WebProcess/WebPage/wc/DrawingAreaWC.cpp
    M Source/WebKit/WebProcess/WebPage/wc/DrawingAreaWC.h
    M Source/WebKit/WebProcess/WebPage/wc/GraphicsLayerWC.cpp
    M Source/WebKit/WebProcess/WebPage/wc/GraphicsLayerWC.h
    M Source/WebKit/WebProcess/WebPage/wc/WCUpdateInfo.h
    M Source/WebKit/WebProcess/WebPage/wc/WCUpdateInfo.serialization.in

  Log Message:
  -----------
  GraphicsLayerWC: site isolation support
https://bugs.webkit.org/show_bug.cgi?id=254902

Reviewed by Don Olmstead.

This is the initial support of site isolation for GraphicsLayerWC.
Cocoa port (aka RemoteLayerTree and GraphicsLayerCARemote) transfers a
layer tree to UI process, GraphicsLayerWC transfers a layer tree to
GPU process. GPU process renders a remote child frame into a texture,
and attach the texture into the content of iframe layer of the parent
frame's layer tree. Added WCRemoteFrameHostLayerManager class to
manage a HashMap from a LayerHostingContextIdentifier to a
BitmapTexture.

This has a problem now. Updating remote child frame's layer tree
doesn't trigger the parent frame's repaint. For the workaround, you
need to manually click a browser window of MiniBrowser to repaint.
Keep http/tests/site-isolation tests skipped for WinCairo.

MiniBrowser has to enable SiteIsolationEnabled option to test it by
using the internal settings menu item or adding the following code.
> WKPreferencesSetBoolValueForKeyForTesting(preferences.get(), true, createWKString("SiteIsolationEnabled").get());

Fixed a bug of TextureMapperGL::endPainting. It should restore a
previous frame buffer that TextureMapperGL::beginPainting saved.
TextureMapperGL supports the offscreen rendering mode for
WebKitTestRunner pixel dump mode. It's not a problem for
WebKitTestRunner because it renders a layer tree always to a texture.
In site-isolation, however, remote frame's layer tree renders to a
texture and main frame layer tree to a frame buffer. After rendering
to a texture, it has to restore the previous frame buffer.

* Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::endPainting): Restore the previous framebuffer.
* Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::didClose):
* Source/WebKit/GPUProcess/graphics/wc/RemoteWCLayerTreeHost.cpp:
(WebKit::remoteGraphicsStreamWorkQueue):
* Source/WebKit/GPUProcess/graphics/wc/RemoteWCLayerTreeHost.h:
* Source/WebKit/GPUProcess/graphics/wc/WCRemoteFrameHostLayerManager.cpp: Added.
(WebKit::WCRemoteFrameHostLayerManager::singleton):
(WebKit::WCRemoteFrameHostLayerManager::acquireRemoteFrameHostLayer):
(WebKit::WCRemoteFrameHostLayerManager::releaseRemoteFrameHostLayer):
(WebKit::WCRemoteFrameHostLayerManager::updateTexture):
(WebKit::WCRemoteFrameHostLayerManager::removeAllLayersForProcess):
* Source/WebKit/GPUProcess/graphics/wc/WCRemoteFrameHostLayerManager.h: Added.
* Source/WebKit/GPUProcess/graphics/wc/WCScene.cpp:
(WebKit::WCScene::update):
* Source/WebKit/PlatformPlayStation.cmake:
* Source/WebKit/PlatformWin.cmake:
* Source/WebKit/WebProcess/WebPage/wc/DrawingAreaWC.cpp:
(WebKit::DrawingAreaWC::DrawingAreaWC):
(WebKit::DrawingAreaWC::updateRootLayers):
(WebKit::DrawingAreaWC::setRootCompositingLayer):
(WebKit::DrawingAreaWC::addRootFrame):
(WebKit::DrawingAreaWC::attachViewOverlayGraphicsLayer):
(WebKit::DrawingAreaWC::updatePreferences):
(WebKit::DrawingAreaWC::shouldUseTiledBackingForFrameView const):
(WebKit::DrawingAreaWC::updateGeometryWC):
(WebKit::DrawingAreaWC::isCompositingMode):
(WebKit::DrawingAreaWC::sendUpdateAC):
(WebKit::DrawingAreaWC::rootLayerInfoWithFrameIdentifier):
* Source/WebKit/WebProcess/WebPage/wc/DrawingAreaWC.h:
* Source/WebKit/WebProcess/WebPage/wc/GraphicsLayerWC.cpp:
(WebKit::GraphicsLayerWC::setContentsToPlatformLayerHost):
(WebKit::GraphicsLayerWC::flushCompositingStateForThisLayerOnly):
* Source/WebKit/WebProcess/WebPage/wc/GraphicsLayerWC.h:
* Source/WebKit/WebProcess/WebPage/wc/WCUpdateInfo.h:
(WebKit::WCLayerUpdateInfo::encode const):
(WebKit::WCLayerUpdateInfo::decode):
(WebKit::WCUpdateInfo::encode const):
(WebKit::WCUpdateInfo::decode):

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




More information about the webkit-changes mailing list