Title: [289642] trunk/Source/WebKit
Revision
289642
Author
[email protected]
Date
2022-02-11 11:47:46 -0800 (Fri, 11 Feb 2022)

Log Message

Introduce a RemoteLayerBackingStoreCollection subclass for GPU Process-based rendering
https://bugs.webkit.org/show_bug.cgi?id=236468

Reviewed by Tim Horton.

Add RemoteLayerWithRemoteRenderingBackingStoreCollection, a subclass of RemoteLayerBackingStoreCollection
which is instantiated by RemoteLayerTreeContext when DOM rendering in GPU process is enabled.

Delegate buffer allocation to this now polymorphic class; RemoteLayerBackingStore no longer
consults shouldUseRemoteRenderingFor().

RemoteLayerWithRemoteRenderingBackingStoreCollection needs a back pointer to RemoteLayerTreeContext
to get to the RemoteRenderingBackendProxy.

* Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::backingStoreCollection const):
(WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
* Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h:
(WebKit::RemoteLayerBackingStoreCollection::layerTreeContext const):
* Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm:
(WebKit::RemoteLayerBackingStoreCollection::RemoteLayerBackingStoreCollection):
(WebKit::RemoteLayerBackingStoreCollection::allocateBufferForBackingStore):
* Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStoreCollection.h: Added.
* Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStoreCollection.mm: Added.
(WebKit::RemoteLayerWithRemoteRenderingBackingStoreCollection::RemoteLayerWithRemoteRenderingBackingStoreCollection):
(WebKit::RemoteLayerWithRemoteRenderingBackingStoreCollection::remoteRenderingBackendProxy):
(WebKit::RemoteLayerWithRemoteRenderingBackingStoreCollection::allocateBufferForBackingStore):
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
(WebKit::RemoteLayerTreeContext::backingStoreCollection):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::RemoteLayerTreeContext):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (289641 => 289642)


--- trunk/Source/WebKit/ChangeLog	2022-02-11 19:45:20 UTC (rev 289641)
+++ trunk/Source/WebKit/ChangeLog	2022-02-11 19:47:46 UTC (rev 289642)
@@ -1,3 +1,40 @@
+2022-02-11  Simon Fraser  <[email protected]>
+
+        Introduce a RemoteLayerBackingStoreCollection subclass for GPU Process-based rendering
+        https://bugs.webkit.org/show_bug.cgi?id=236468
+
+        Reviewed by Tim Horton.
+
+        Add RemoteLayerWithRemoteRenderingBackingStoreCollection, a subclass of RemoteLayerBackingStoreCollection
+        which is instantiated by RemoteLayerTreeContext when DOM rendering in GPU process is enabled.
+
+        Delegate buffer allocation to this now polymorphic class; RemoteLayerBackingStore no longer
+        consults shouldUseRemoteRenderingFor().
+
+        RemoteLayerWithRemoteRenderingBackingStoreCollection needs a back pointer to RemoteLayerTreeContext
+        to get to the RemoteRenderingBackendProxy.
+
+        * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
+        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
+        (WebKit::RemoteLayerBackingStore::backingStoreCollection const):
+        (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
+        * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h:
+        (WebKit::RemoteLayerBackingStoreCollection::layerTreeContext const):
+        * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm:
+        (WebKit::RemoteLayerBackingStoreCollection::RemoteLayerBackingStoreCollection):
+        (WebKit::RemoteLayerBackingStoreCollection::allocateBufferForBackingStore):
+        * Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStoreCollection.h: Added.
+        * Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStoreCollection.mm: Added.
+        (WebKit::RemoteLayerWithRemoteRenderingBackingStoreCollection::RemoteLayerWithRemoteRenderingBackingStoreCollection):
+        (WebKit::RemoteLayerWithRemoteRenderingBackingStoreCollection::remoteRenderingBackendProxy):
+        (WebKit::RemoteLayerWithRemoteRenderingBackingStoreCollection::allocateBufferForBackingStore):
+        * SourcesCocoa.txt:
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
+        (WebKit::RemoteLayerTreeContext::backingStoreCollection):
+        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
+        (WebKit::RemoteLayerTreeContext::RemoteLayerTreeContext):
+
 2022-02-11  Per Arne Vollan  <[email protected]>
 
         The GPU process should not check in with Launch Services

Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h (289641 => 289642)


--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h	2022-02-11 19:45:20 UTC (rev 289641)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h	2022-02-11 19:47:46 UTC (rev 289642)
@@ -69,6 +69,7 @@
 
     WebCore::FloatSize size() const { return m_size; }
     float scale() const { return m_scale; }
+    WebCore::PixelFormat pixelFormat() const;
     Type type() const { return m_type; }
     bool isOpaque() const { return m_isOpaque; }
     unsigned bytesPerPixel() const;
@@ -111,8 +112,6 @@
 
     bool supportsPartialRepaint();
 
-    WebCore::PixelFormat pixelFormat() const;
-
     PlatformCALayerRemote* m_layer;
 
     WebCore::FloatSize m_size;

Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm (289641 => 289642)


--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm	2022-02-11 19:45:20 UTC (rev 289641)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm	2022-02-11 19:47:46 UTC (rev 289642)
@@ -80,7 +80,7 @@
 RemoteLayerBackingStoreCollection* RemoteLayerBackingStore::backingStoreCollection() const
 {
     if (auto* context = m_layer->context())
-        context->backingStoreCollection();
+        return &context->backingStoreCollection();
 
     return nullptr;
 }
@@ -241,23 +241,9 @@
         return;
     }
 
-    bool shouldUseRemoteRendering = WebProcess::singleton().shouldUseRemoteRenderingFor(WebCore::RenderingPurpose::DOM);
+    if (auto* collection = backingStoreCollection())
+        m_frontBuffer.imageBuffer = collection->allocateBufferForBackingStore(*this);
 
-    switch (m_type) {
-    case Type::IOSurface:
-        if (shouldUseRemoteRendering)
-            m_frontBuffer.imageBuffer = m_layer->context()->ensureRemoteRenderingBackendProxy().createImageBuffer(m_size, WebCore::RenderingMode::Accelerated, m_scale, WebCore::DestinationColorSpace::SRGB(), pixelFormat());
-        else
-            m_frontBuffer.imageBuffer = WebCore::ConcreteImageBuffer<AcceleratedImageBufferShareableMappedBackend>::create(m_size, m_scale, WebCore::DestinationColorSpace::SRGB(), pixelFormat(), nullptr);
-        break;
-    case Type::Bitmap:
-        if (shouldUseRemoteRendering)
-            m_frontBuffer.imageBuffer = m_layer->context()->ensureRemoteRenderingBackendProxy().createImageBuffer(m_size, WebCore::RenderingMode::Unaccelerated, m_scale, WebCore::DestinationColorSpace::SRGB(), pixelFormat());
-        else
-            m_frontBuffer.imageBuffer = WebCore::ConcreteImageBuffer<UnacceleratedImageBufferShareableBackend>::create(m_size, m_scale, WebCore::DestinationColorSpace::SRGB(), pixelFormat(), nullptr);
-        break;
-    }
-
 #if ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
     if (m_includeDisplayList == IncludeDisplayList::Yes)
         m_frontBuffer.displayListImageBuffer = WebCore::ConcreteImageBuffer<CGDisplayListImageBufferBackend>::create(m_size, m_scale, WebCore::DestinationColorSpace::SRGB(), pixelFormat(), nullptr);

Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h (289641 => 289642)


--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h	2022-02-11 19:45:20 UTC (rev 289641)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h	2022-02-11 19:47:46 UTC (rev 289642)
@@ -29,6 +29,10 @@
 #import <wtf/HashSet.h>
 #import <wtf/Noncopyable.h>
 
+namespace WebCore {
+class ImageBuffer;
+}
+
 namespace WebKit {
 
 class RemoteLayerBackingStore;
@@ -39,7 +43,8 @@
     WTF_MAKE_NONCOPYABLE(RemoteLayerBackingStoreCollection);
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    RemoteLayerBackingStoreCollection();
+    RemoteLayerBackingStoreCollection(RemoteLayerTreeContext&);
+    virtual ~RemoteLayerBackingStoreCollection();
 
     void backingStoreWasCreated(RemoteLayerBackingStore&);
     void backingStoreWillBeDestroyed(RemoteLayerBackingStore&);
@@ -56,6 +61,11 @@
 
     void scheduleVolatilityTimer();
 
+    virtual RefPtr<WebCore::ImageBuffer> allocateBufferForBackingStore(const RemoteLayerBackingStore&);
+
+protected:
+    RemoteLayerTreeContext& layerTreeContext() const { return m_layerTreeContext; }
+
 private:
     enum class VolatilityMarkingBehavior : uint8_t {
         IgnoreReachability              = 1 << 0,
@@ -66,6 +76,8 @@
     bool markAllBackingStoreVolatile(OptionSet<VolatilityMarkingBehavior> liveBackingStoreMarkingBehavior, OptionSet<VolatilityMarkingBehavior> unparentedBackingStoreMarkingBehavior);
     void volatilityTimerFired();
 
+    RemoteLayerTreeContext& m_layerTreeContext;
+
     HashSet<RemoteLayerBackingStore*> m_liveBackingStore;
     HashSet<RemoteLayerBackingStore*> m_unparentedBackingStore;
 

Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm (289641 => 289642)


--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm	2022-02-11 19:45:20 UTC (rev 289641)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm	2022-02-11 19:47:46 UTC (rev 289642)
@@ -36,11 +36,14 @@
 
 namespace WebKit {
 
-RemoteLayerBackingStoreCollection::RemoteLayerBackingStoreCollection()
-    : m_volatilityTimer(*this, &RemoteLayerBackingStoreCollection::volatilityTimerFired)
+RemoteLayerBackingStoreCollection::RemoteLayerBackingStoreCollection(RemoteLayerTreeContext& layerTreeContext)
+    : m_layerTreeContext(layerTreeContext)
+    , m_volatilityTimer(*this, &RemoteLayerBackingStoreCollection::volatilityTimerFired)
 {
 }
 
+RemoteLayerBackingStoreCollection::~RemoteLayerBackingStoreCollection() = default;
+
 void RemoteLayerBackingStoreCollection::willFlushLayers()
 {
     m_inLayerFlush = true;
@@ -182,4 +185,15 @@
     m_volatilityTimer.startRepeating(volatilityTimerInterval);
 }
 
+RefPtr<WebCore::ImageBuffer> RemoteLayerBackingStoreCollection::allocateBufferForBackingStore(const RemoteLayerBackingStore& backingStore)
+{
+    switch (backingStore.type()) {
+    case RemoteLayerBackingStore::Type::IOSurface:
+        return WebCore::ConcreteImageBuffer<AcceleratedImageBufferShareableMappedBackend>::create(backingStore.size(), backingStore.scale(), WebCore::DestinationColorSpace::SRGB(), backingStore.pixelFormat(), nullptr);
+    case RemoteLayerBackingStore::Type::Bitmap:
+        return WebCore::ConcreteImageBuffer<UnacceleratedImageBufferShareableBackend>::create(backingStore.size(), backingStore.scale(), WebCore::DestinationColorSpace::SRGB(), backingStore.pixelFormat(), nullptr);
+    }
+    return nullptr;
+}
+
 } // namespace WebKit

Added: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStoreCollection.h (0 => 289642)


--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStoreCollection.h	                        (rev 0)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStoreCollection.h	2022-02-11 19:47:46 UTC (rev 289642)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2022 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#import "RemoteLayerBackingStoreCollection.h"
+
+namespace WebKit {
+
+class RemoteRenderingBackendProxy;
+
+// "RemoteLayer" refers to UI-side compositing.
+// "RemoteRendering" refers to GPU-process rendering.
+class RemoteLayerWithRemoteRenderingBackingStoreCollection : public RemoteLayerBackingStoreCollection {
+public:
+    RemoteLayerWithRemoteRenderingBackingStoreCollection(RemoteLayerTreeContext&);
+    virtual ~RemoteLayerWithRemoteRenderingBackingStoreCollection() = default;
+
+private:
+    RefPtr<WebCore::ImageBuffer> allocateBufferForBackingStore(const RemoteLayerBackingStore&) final;
+    
+    RemoteRenderingBackendProxy& remoteRenderingBackendProxy();
+};
+
+} // namespace WebKit

Added: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStoreCollection.mm (0 => 289642)


--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStoreCollection.mm	                        (rev 0)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStoreCollection.mm	2022-02-11 19:47:46 UTC (rev 289642)
@@ -0,0 +1,50 @@
+ /*
+ * Copyright (C) 2022 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "RemoteLayerWithRemoteRenderingBackingStoreCollection.h"
+
+#import "RemoteLayerTreeContext.h"
+#import "RemoteRenderingBackendProxy.h"
+
+namespace WebKit {
+
+RemoteLayerWithRemoteRenderingBackingStoreCollection::RemoteLayerWithRemoteRenderingBackingStoreCollection(RemoteLayerTreeContext& layerTreeContext)
+    : RemoteLayerBackingStoreCollection(layerTreeContext)
+{
+}
+
+RemoteRenderingBackendProxy& RemoteLayerWithRemoteRenderingBackingStoreCollection::remoteRenderingBackendProxy()
+{
+    return layerTreeContext().ensureRemoteRenderingBackendProxy();
+}
+
+RefPtr<WebCore::ImageBuffer> RemoteLayerWithRemoteRenderingBackingStoreCollection::allocateBufferForBackingStore(const RemoteLayerBackingStore& backingStore)
+{
+    auto renderingMode = backingStore.type() == RemoteLayerBackingStore::Type::IOSurface ? WebCore::RenderingMode::Accelerated : WebCore::RenderingMode::Unaccelerated;
+    return remoteRenderingBackendProxy().createImageBuffer(backingStore.size(), renderingMode, backingStore.scale(), WebCore::DestinationColorSpace::SRGB(), backingStore.pixelFormat());
+}
+
+} // namespace WebKit

Modified: trunk/Source/WebKit/SourcesCocoa.txt (289641 => 289642)


--- trunk/Source/WebKit/SourcesCocoa.txt	2022-02-11 19:45:20 UTC (rev 289641)
+++ trunk/Source/WebKit/SourcesCocoa.txt	2022-02-11 19:47:46 UTC (rev 289642)
@@ -239,6 +239,7 @@
 
 Shared/RemoteLayerTree/RemoteLayerBackingStore.mm
 Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm
+Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStoreCollection.mm
 Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm
 Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm
 Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (289641 => 289642)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2022-02-11 19:45:20 UTC (rev 289641)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2022-02-11 19:47:46 UTC (rev 289642)
@@ -2599,6 +2599,8 @@
 		0F707C791A1FEEA300DA7A45 /* RemoteLayerTreeScrollingPerformanceData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerTreeScrollingPerformanceData.h; sourceTree = "<group>"; };
 		0F73B767222B38C600805316 /* ScrollingTreeOverflowScrollingNodeRemoteMac.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingTreeOverflowScrollingNodeRemoteMac.cpp; sourceTree = "<group>"; };
 		0F73B768222B38C600805316 /* ScrollingTreeOverflowScrollingNodeRemoteMac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeOverflowScrollingNodeRemoteMac.h; sourceTree = "<group>"; };
+		0F80264627AB4AEF00EC6ED7 /* RemoteLayerWithRemoteRenderingBackingStoreCollection.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteLayerWithRemoteRenderingBackingStoreCollection.mm; sourceTree = "<group>"; };
+		0F80264727AB4AEF00EC6ED7 /* RemoteLayerWithRemoteRenderingBackingStoreCollection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RemoteLayerWithRemoteRenderingBackingStoreCollection.h; sourceTree = "<group>"; };
 		0F850FE41ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPerformanceLoggingClient.cpp; sourceTree = "<group>"; };
 		0F850FE51ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPerformanceLoggingClient.h; sourceTree = "<group>"; };
 		0F931C1A18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeOverflowScrollingNodeIOS.h; sourceTree = "<group>"; };
@@ -8171,6 +8173,8 @@
 				2DDE0AF918298CC900F97EAA /* RemoteLayerTreePropertyApplier.mm */,
 				1AF1AC6A1651759E00C17D7F /* RemoteLayerTreeTransaction.h */,
 				1AF1AC691651759E00C17D7F /* RemoteLayerTreeTransaction.mm */,
+				0F80264727AB4AEF00EC6ED7 /* RemoteLayerWithRemoteRenderingBackingStoreCollection.h */,
+				0F80264627AB4AEF00EC6ED7 /* RemoteLayerWithRemoteRenderingBackingStoreCollection.mm */,
 				0F5947A1187B3B7D00437857 /* RemoteScrollingCoordinatorTransaction.cpp */,
 				0F5947A2187B3B7D00437857 /* RemoteScrollingCoordinatorTransaction.h */,
 				0FCD094E24C79F5B000C6D39 /* RemoteScrollingUIState.cpp */,

Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h (289641 => 289642)


--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h	2022-02-11 19:45:20 UTC (rev 289641)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h	2022-02-11 19:47:46 UTC (rev 289642)
@@ -68,7 +68,7 @@
 
     void willStartAnimationOnLayer(PlatformCALayerRemote&);
 
-    RemoteLayerBackingStoreCollection& backingStoreCollection() { return m_backingStoreCollection; }
+    RemoteLayerBackingStoreCollection& backingStoreCollection() { return *m_backingStoreCollection; }
     
     void setNextRenderingUpdateRequiresSynchronousImageDecoding(bool requireSynchronousDecoding) { m_nextRenderingUpdateRequiresSynchronousImageDecoding = requireSynchronousDecoding; }
     bool nextRenderingUpdateRequiresSynchronousImageDecoding() const { return m_nextRenderingUpdateRequiresSynchronousImageDecoding; }
@@ -98,14 +98,13 @@
 
     HashSet<GraphicsLayerCARemote*> m_liveGraphicsLayers;
 
-    RemoteLayerBackingStoreCollection m_backingStoreCollection;
-    
-    RemoteLayerTreeTransaction* m_currentTransaction;
+    std::unique_ptr<RemoteLayerBackingStoreCollection> m_backingStoreCollection;
 
     WebCore::LayerPool m_layerPool;
-    
+
+    RemoteLayerTreeTransaction* m_currentTransaction { nullptr };
+
     bool m_nextRenderingUpdateRequiresSynchronousImageDecoding { false };
-
     bool m_useCGDisplayListsForDOMRendering { false };
 };
 

Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm (289641 => 289642)


--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm	2022-02-11 19:45:20 UTC (rev 289641)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm	2022-02-11 19:47:46 UTC (rev 289642)
@@ -29,8 +29,8 @@
 #import "GenericCallback.h"
 #import "GraphicsLayerCARemote.h"
 #import "PlatformCALayerRemote.h"
-#import "RemoteLayerBackingStoreCollection.h"
 #import "RemoteLayerTreeTransaction.h"
+#import "RemoteLayerWithRemoteRenderingBackingStoreCollection.h"
 #import "WebPage.h"
 #import <WebCore/Frame.h>
 #import <WebCore/FrameView.h>
@@ -43,8 +43,11 @@
 
 RemoteLayerTreeContext::RemoteLayerTreeContext(WebPage& webPage)
     : m_webPage(webPage)
-    , m_currentTransaction(nullptr)
 {
+    if (WebProcess::singleton().shouldUseRemoteRenderingFor(WebCore::RenderingPurpose::DOM))
+        m_backingStoreCollection = makeUnique<RemoteLayerWithRemoteRenderingBackingStoreCollection>(*this);
+    else
+        m_backingStoreCollection = makeUnique<RemoteLayerBackingStoreCollection>(*this);
 }
 
 RemoteLayerTreeContext::~RemoteLayerTreeContext()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to