Title: [289603] trunk/Source/WebKit
Revision
289603
Author
[email protected]
Date
2022-02-10 21:36:37 -0800 (Thu, 10 Feb 2022)

Log Message

Have RemoteLayerBackingStore talk to RemoteLayerBackingStoreCollection directly
https://bugs.webkit.org/show_bug.cgi?id=236463

Reviewed by Tim Horton.

There doesn't seem to be any benefit to going via RemoteLayerTreeContext.

* Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::RemoteLayerBackingStore):
(WebKit::RemoteLayerBackingStore::~RemoteLayerBackingStore):
(WebKit::RemoteLayerBackingStore::backingStoreCollection const):
(WebKit::RemoteLayerBackingStore::display):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::backingStoreWasCreated): Deleted.
(WebKit::RemoteLayerTreeContext::backingStoreWillBeDestroyed): Deleted.
(WebKit::RemoteLayerTreeContext::backingStoreWillBeDisplayed): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (289602 => 289603)


--- trunk/Source/WebKit/ChangeLog	2022-02-11 05:17:40 UTC (rev 289602)
+++ trunk/Source/WebKit/ChangeLog	2022-02-11 05:36:37 UTC (rev 289603)
@@ -1,3 +1,24 @@
+2022-02-10  Simon Fraser  <[email protected]>
+
+        Have RemoteLayerBackingStore talk to RemoteLayerBackingStoreCollection directly
+        https://bugs.webkit.org/show_bug.cgi?id=236463
+
+        Reviewed by Tim Horton.
+
+        There doesn't seem to be any benefit to going via RemoteLayerTreeContext.
+
+        * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
+        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
+        (WebKit::RemoteLayerBackingStore::RemoteLayerBackingStore):
+        (WebKit::RemoteLayerBackingStore::~RemoteLayerBackingStore):
+        (WebKit::RemoteLayerBackingStore::backingStoreCollection const):
+        (WebKit::RemoteLayerBackingStore::display):
+        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
+        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
+        (WebKit::RemoteLayerTreeContext::backingStoreWasCreated): Deleted.
+        (WebKit::RemoteLayerTreeContext::backingStoreWillBeDestroyed): Deleted.
+        (WebKit::RemoteLayerTreeContext::backingStoreWillBeDisplayed): Deleted.
+
 2022-02-10  Said Abou-Hallawa  <[email protected]>
 
         [GPU Process] Delete GraphicsContext::clipToDrawingCommands()

Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h (289602 => 289603)


--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h	2022-02-11 05:17:40 UTC (rev 289602)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h	2022-02-11 05:36:37 UTC (rev 289603)
@@ -44,6 +44,7 @@
 namespace WebKit {
 
 class PlatformCALayerRemote;
+class RemoteLayerBackingStoreCollection;
 
 class RemoteLayerBackingStore {
     WTF_MAKE_NONCOPYABLE(RemoteLayerBackingStore);
@@ -103,6 +104,8 @@
     void clearBackingStore();
 
 private:
+    RemoteLayerBackingStoreCollection* backingStoreCollection() const;
+
     void drawInContext(WebCore::GraphicsContext&);
     void swapToValidFrontBuffer();
 

Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm (289602 => 289603)


--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm	2022-02-11 05:17:40 UTC (rev 289602)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm	2022-02-11 05:36:37 UTC (rev 289603)
@@ -61,8 +61,9 @@
 {
     if (!m_layer)
         return;
-    if (RemoteLayerTreeContext* context = m_layer->context())
-        context->backingStoreWasCreated(*this);
+
+    if (auto* collection = backingStoreCollection())
+        collection->backingStoreWasCreated(*this);
 }
 
 RemoteLayerBackingStore::~RemoteLayerBackingStore()
@@ -72,10 +73,18 @@
     if (!m_layer)
         return;
 
-    if (RemoteLayerTreeContext* context = m_layer->context())
-        context->backingStoreWillBeDestroyed(*this);
+    if (auto* collection = backingStoreCollection())
+        collection->backingStoreWillBeDestroyed(*this);
 }
 
+RemoteLayerBackingStoreCollection* RemoteLayerBackingStore::backingStoreCollection() const
+{
+    if (auto* context = m_layer->context())
+        context->backingStoreCollection();
+
+    return nullptr;
+}
+
 void RemoteLayerBackingStore::ensureBackingStore(Type type, WebCore::FloatSize size, float scale, bool deepColor, bool isOpaque, IncludeDisplayList includeDisplayList)
 {
     if (m_type == type && m_size == size && m_scale == scale && m_deepColor == deepColor && m_isOpaque == isOpaque && m_includeDisplayList == includeDisplayList)
@@ -276,8 +285,8 @@
     m_lastDisplayTime = MonotonicTime::now();
 
     bool needToEncodeBackingStore = false;
-    if (RemoteLayerTreeContext* context = m_layer->context())
-        needToEncodeBackingStore = context->backingStoreWillBeDisplayed(*this);
+    if (auto* collection = backingStoreCollection())
+        needToEncodeBackingStore = collection->backingStoreWillBeDisplayed(*this);
 
     if (m_layer->owner()->platformCALayerDelegatesDisplay(m_layer)) {
         m_layer->owner()->platformCALayerLayerDisplay(m_layer);

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


--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h	2022-02-11 05:17:40 UTC (rev 289602)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h	2022-02-11 05:36:37 UTC (rev 289603)
@@ -52,10 +52,6 @@
     void graphicsLayerDidEnterContext(GraphicsLayerCARemote&);
     void graphicsLayerWillLeaveContext(GraphicsLayerCARemote&);
 
-    void backingStoreWasCreated(RemoteLayerBackingStore&);
-    void backingStoreWillBeDestroyed(RemoteLayerBackingStore&);
-    bool backingStoreWillBeDisplayed(RemoteLayerBackingStore&);
-
     WebCore::LayerPool& layerPool() { return m_layerPool; }
 
     float deviceScaleFactor() const;

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


--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm	2022-02-11 05:17:40 UTC (rev 289602)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm	2022-02-11 05:36:37 UTC (rev 289603)
@@ -120,21 +120,6 @@
     m_liveGraphicsLayers.remove(&layer);
 }
 
-void RemoteLayerTreeContext::backingStoreWasCreated(RemoteLayerBackingStore& backingStore)
-{
-    m_backingStoreCollection.backingStoreWasCreated(backingStore);
-}
-
-void RemoteLayerTreeContext::backingStoreWillBeDestroyed(RemoteLayerBackingStore& backingStore)
-{
-    m_backingStoreCollection.backingStoreWillBeDestroyed(backingStore);
-}
-
-bool RemoteLayerTreeContext::backingStoreWillBeDisplayed(RemoteLayerBackingStore& backingStore)
-{
-    return m_backingStoreCollection.backingStoreWillBeDisplayed(backingStore);
-}
-
 Ref<GraphicsLayer> RemoteLayerTreeContext::createGraphicsLayer(WebCore::GraphicsLayer::Type layerType, GraphicsLayerClient& client)
 {
     return adoptRef(*new GraphicsLayerCARemote(layerType, client, *this));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to