Title: [278217] trunk/Source
Revision
278217
Author
wei...@apple.com
Date
2021-05-28 11:54:27 -0700 (Fri, 28 May 2021)

Log Message

Add stub implementation of CA separated portal bits for GraphicsLayer
https://bugs.webkit.org/show_bug.cgi?id=226343

Reviewed by Simon Fraser.

Source/WebCore:

Plumbs isSeparatedPortal and isDescendentOfSeparatedPortal bits through GraphicsLayer.
Renames setSeparated to setIsSeparated for consistency.

Currently unused, but getting the bits in is big enough that its helpful
to land on its own.

* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::isIsSeparated const):
(WebCore::GraphicsLayer::setIsSeparated):
(WebCore::GraphicsLayer::isSeparatedPortal const):
(WebCore::GraphicsLayer::setIsSeparatedPortal):
(WebCore::GraphicsLayer::isDescendentOfSeparatedPortal const):
(WebCore::GraphicsLayer::setIsDescendentOfSeparatedPortal):
(WebCore::GraphicsLayer::isSeparated const): Deleted.
(WebCore::GraphicsLayer::setSeparated): Deleted.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setIsSeparated):
(WebCore::GraphicsLayerCA::setIsSeparatedPortal):
(WebCore::GraphicsLayerCA::setIsDescendentOfSeparatedPortal):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateIsSeparated):
(WebCore::GraphicsLayerCA::updateIsSeparatedPortal):
(WebCore::GraphicsLayerCA::updateIsDescendentOfSeparatedPortal):
(WebCore::GraphicsLayerCA::setSeparated): Deleted.
(WebCore::GraphicsLayerCA::updateSeparated): Deleted.
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::setIsSeparated):
(WebCore::PlatformCALayerCocoa::isSeparatedPortal const):
(WebCore::PlatformCALayerCocoa::setIsSeparatedPortal):
(WebCore::PlatformCALayerCocoa::isDescendentOfSeparatedPortal const):
(WebCore::PlatformCALayerCocoa::setIsDescendentOfSeparatedPortal):
(WebCore::PlatformCALayerCocoa::setSeparated): Deleted.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):

Source/WebKit:

Plumbs isSeparatedPortal and isDescendentOfSeparatedPortal bits through GraphicsLayer.
Renames setSeparated to setIsSeparated for consistency.

Currently unused, but getting the bits in is big enough that its helpful
to land on its own.

* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer):
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
(WebKit::dumpChangedLayers):
(WebKit::RemoteLayerTreeTransaction::RemoteLayerTreeTransaction): Deleted.
(WebKit::RemoteLayerTreeTransaction::~RemoteLayerTreeTransaction): Deleted.
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::setIsSeparated):
(WebKit::PlatformCALayerRemote::isSeparatedPortal const):
(WebKit::PlatformCALayerRemote::setIsSeparatedPortal):
(WebKit::PlatformCALayerRemote::isDescendentOfSeparatedPortal const):
(WebKit::PlatformCALayerRemote::setIsDescendentOfSeparatedPortal):
(WebKit::PlatformCALayerRemote::setSeparated): Deleted.
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:

Source/WTF:

* wtf/PlatformHave.h: Add HAVE_CORE_ANIMATION_SEPARATED_PORTALS.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (278216 => 278217)


--- trunk/Source/WTF/ChangeLog	2021-05-28 18:47:39 UTC (rev 278216)
+++ trunk/Source/WTF/ChangeLog	2021-05-28 18:54:27 UTC (rev 278217)
@@ -1,3 +1,12 @@
+2021-05-28  Sam Weinig  <wei...@apple.com>
+
+        Add stub implementation of CA separated portal bits for GraphicsLayer
+        https://bugs.webkit.org/show_bug.cgi?id=226343
+
+        Reviewed by Simon Fraser.
+
+        * wtf/PlatformHave.h: Add HAVE_CORE_ANIMATION_SEPARATED_PORTALS.
+
 2021-05-28  Chris Dumez  <cdu...@apple.com>
 
         Unreviewed build fix after r277881.

Modified: trunk/Source/WTF/wtf/PlatformHave.h (278216 => 278217)


--- trunk/Source/WTF/wtf/PlatformHave.h	2021-05-28 18:47:39 UTC (rev 278216)
+++ trunk/Source/WTF/wtf/PlatformHave.h	2021-05-28 18:54:27 UTC (rev 278217)
@@ -903,6 +903,7 @@
     || ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
 #if !defined(HAVE_CORE_ANIMATION_SEPARATED_LAYERS)
 #define HAVE_CORE_ANIMATION_SEPARATED_LAYERS 1
+#define HAVE_CORE_ANIMATION_SEPARATED_PORTALS 1
 #endif
 #endif
 

Modified: trunk/Source/WebCore/ChangeLog (278216 => 278217)


--- trunk/Source/WebCore/ChangeLog	2021-05-28 18:47:39 UTC (rev 278216)
+++ trunk/Source/WebCore/ChangeLog	2021-05-28 18:54:27 UTC (rev 278217)
@@ -1,3 +1,50 @@
+2021-05-28  Sam Weinig  <wei...@apple.com>
+
+        Add stub implementation of CA separated portal bits for GraphicsLayer
+        https://bugs.webkit.org/show_bug.cgi?id=226343
+
+        Reviewed by Simon Fraser.
+
+        Plumbs isSeparatedPortal and isDescendentOfSeparatedPortal bits through GraphicsLayer.
+        Renames setSeparated to setIsSeparated for consistency.
+
+        Currently unused, but getting the bits in is big enough that its helpful
+        to land on its own.
+
+        * platform/graphics/GraphicsLayer.cpp:
+        (WebCore::GraphicsLayer::GraphicsLayer):
+        * platform/graphics/GraphicsLayer.h:
+        (WebCore::GraphicsLayer::isIsSeparated const):
+        (WebCore::GraphicsLayer::setIsSeparated):
+        (WebCore::GraphicsLayer::isSeparatedPortal const):
+        (WebCore::GraphicsLayer::setIsSeparatedPortal):
+        (WebCore::GraphicsLayer::isDescendentOfSeparatedPortal const):
+        (WebCore::GraphicsLayer::setIsDescendentOfSeparatedPortal):
+        (WebCore::GraphicsLayer::isSeparated const): Deleted.
+        (WebCore::GraphicsLayer::setSeparated): Deleted.
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::setIsSeparated):
+        (WebCore::GraphicsLayerCA::setIsSeparatedPortal):
+        (WebCore::GraphicsLayerCA::setIsDescendentOfSeparatedPortal):
+        (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
+        (WebCore::GraphicsLayerCA::updateIsSeparated):
+        (WebCore::GraphicsLayerCA::updateIsSeparatedPortal):
+        (WebCore::GraphicsLayerCA::updateIsDescendentOfSeparatedPortal):
+        (WebCore::GraphicsLayerCA::setSeparated): Deleted.
+        (WebCore::GraphicsLayerCA::updateSeparated): Deleted.
+        * platform/graphics/ca/GraphicsLayerCA.h:
+        * platform/graphics/ca/PlatformCALayer.h:
+        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
+        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
+        (WebCore::PlatformCALayerCocoa::setIsSeparated):
+        (WebCore::PlatformCALayerCocoa::isSeparatedPortal const):
+        (WebCore::PlatformCALayerCocoa::setIsSeparatedPortal):
+        (WebCore::PlatformCALayerCocoa::isDescendentOfSeparatedPortal const):
+        (WebCore::PlatformCALayerCocoa::setIsDescendentOfSeparatedPortal):
+        (WebCore::PlatformCALayerCocoa::setSeparated): Deleted.
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateGeometry):
+
 2021-05-28  Brent Fulgham  <bfulg...@apple.com>
 
         Buffer computations should use correct type

Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp (278216 => 278217)


--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp	2021-05-28 18:47:39 UTC (rev 278216)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp	2021-05-28 18:54:27 UTC (rev 278217)
@@ -150,8 +150,12 @@
     , m_userInteractionEnabled(true)
     , m_canDetachBackingStore(true)
 #if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
-    , m_separated(false)
+    , m_isSeparated(false)
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+    , m_isSeparatedPortal(false)
+    , m_isDescendentOfSeparatedPortal(false)
 #endif
+#endif
 {
 #ifndef NDEBUG
     client().verifyNotPainting();

Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (278216 => 278217)


--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h	2021-05-28 18:47:39 UTC (rev 278216)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h	2021-05-28 18:54:27 UTC (rev 278217)
@@ -395,9 +395,14 @@
     virtual void setUsesDisplayListDrawing(bool b) { m_usesDisplayListDrawing = b; }
 
 #if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
-    bool isSeparated() const { return m_separated; }
-    virtual void setSeparated(bool b) { m_separated = b; }
+    bool isIsSeparated() const { return m_isSeparated; }
+    virtual void setIsSeparated(bool b) { m_isSeparated = b; }
+
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+    bool isSeparatedPortal() const { return m_isSeparatedPortal; }
+    virtual void setIsSeparatedPortal(bool b) { m_isSeparatedPortal = b; }
 #endif
+#endif
 
     bool needsBackdrop() const { return !m_backdropFilters.isEmpty(); }
 
@@ -665,6 +670,14 @@
     GraphicsLayer* replicatedLayer() const { return m_replicatedLayer; }
     virtual void setReplicatedLayer(GraphicsLayer* layer) { m_replicatedLayer = layer; }
 
+#if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+    bool isDescendentOfSeparatedPortal() const { return m_isDescendentOfSeparatedPortal; }
+    virtual void setIsDescendentOfSeparatedPortal(bool b) { m_isDescendentOfSeparatedPortal = b; }
+#endif
+#endif
+
+
     void dumpProperties(WTF::TextStream&, LayerTreeAsTextBehavior) const;
     virtual void dumpAdditionalProperties(WTF::TextStream&, LayerTreeAsTextBehavior) const { }
 
@@ -731,8 +744,12 @@
     bool m_userInteractionEnabled : 1;
     bool m_canDetachBackingStore : 1;
 #if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
-    bool m_separated : 1;
+    bool m_isSeparated : 1;
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+    bool m_isSeparatedPortal : 1;
+    bool m_isDescendentOfSeparatedPortal : 1;
 #endif
+#endif
 
     int m_repaintCount { 0 };
 

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (278216 => 278217)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2021-05-28 18:47:39 UTC (rev 278216)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2021-05-28 18:54:27 UTC (rev 278217)
@@ -782,15 +782,36 @@
 }
 
 #if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
-void GraphicsLayerCA::setSeparated(bool separated)
+void GraphicsLayerCA::setIsSeparated(bool isSeparated)
 {
-    if (separated == m_separated)
+    if (isSeparated == m_isSeparated)
         return;
 
-    GraphicsLayer::setSeparated(separated);
+    GraphicsLayer::setIsSeparated(isSeparated);
     noteLayerPropertyChanged(SeparatedChanged);
 }
+
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+void GraphicsLayerCA::setIsSeparatedPortal(bool isSeparatedPortal)
+{
+    if (isSeparatedPortal == m_isSeparatedPortal)
+        return;
+
+    GraphicsLayer::setIsSeparatedPortal(isSeparatedPortal);
+    noteLayerPropertyChanged(SeparatedPortalChanged);
+
+}
+
+void GraphicsLayerCA::setIsDescendentOfSeparatedPortal(bool isDescendentOfSeparatedPortal)
+{
+    if (isDescendentOfSeparatedPortal == m_isDescendentOfSeparatedPortal)
+        return;
+
+    GraphicsLayer::setIsDescendentOfSeparatedPortal(isDescendentOfSeparatedPortal);
+    noteLayerPropertyChanged(DescendentOfSeparatedPortalChanged);
+}
 #endif
+#endif
 
 void GraphicsLayerCA::setBackgroundColor(const Color& color)
 {
@@ -1985,8 +2006,16 @@
 
 #if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
     if (m_uncommittedChanges & SeparatedChanged)
-        updateSeparated();
+        updateIsSeparated();
+
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+    if (m_uncommittedChanges & SeparatedPortalChanged)
+        updateIsSeparatedPortal();
+
+    if (m_uncommittedChanges & DescendentOfSeparatedPortalChanged)
+        updateIsDescendentOfSeparatedPortal();
 #endif
+#endif
 
     if (m_uncommittedChanges & ChildrenChanged) {
         updateSublayerList();
@@ -2432,11 +2461,23 @@
 }
 
 #if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
-void GraphicsLayerCA::updateSeparated()
+void GraphicsLayerCA::updateIsSeparated()
 {
-    m_layer->setSeparated(m_separated);
+    m_layer->setIsSeparated(m_isSeparated);
 }
+
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+void GraphicsLayerCA::updateIsSeparatedPortal()
+{
+    m_layer->setIsSeparatedPortal(m_isSeparatedPortal);
+}
+
+void GraphicsLayerCA::updateIsDescendentOfSeparatedPortal()
+{
+    m_layer->setIsDescendentOfSeparatedPortal(m_isDescendentOfSeparatedPortal);
+}
 #endif
+#endif
 
 bool GraphicsLayerCA::updateStructuralLayer()
 {

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (278216 => 278217)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h	2021-05-28 18:47:39 UTC (rev 278216)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h	2021-05-28 18:54:27 UTC (rev 278217)
@@ -96,8 +96,11 @@
     WEBCORE_EXPORT void setUsesDisplayListDrawing(bool) override;
     WEBCORE_EXPORT void setUserInteractionEnabled(bool) override;
 #if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
-    WEBCORE_EXPORT void setSeparated(bool) override;
+    WEBCORE_EXPORT void setIsSeparated(bool) override;
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+    WEBCORE_EXPORT void setIsSeparatedPortal(bool) override;
 #endif
+#endif
 
     WEBCORE_EXPORT void setBackgroundColor(const Color&) override;
 
@@ -229,6 +232,10 @@
     WEBCORE_EXPORT void setIsTrackingDisplayListReplay(bool) override;
     WEBCORE_EXPORT String replayDisplayListAsText(DisplayList::AsTextFlags) const override;
 
+#if HAVE(CORE_ANIMATION_SEPARATED_LAYERS) && HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+    WEBCORE_EXPORT void setIsDescendentOfSeparatedPortal(bool) override;
+#endif
+
     WEBCORE_EXPORT double backingStoreMemoryEstimate() const override;
 
     WEBCORE_EXPORT bool shouldRepaintOnSizeChange() const override;
@@ -450,8 +457,12 @@
     void updateWindRule();
 
 #if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
-    void updateSeparated();
+    void updateIsSeparated();
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+    void updateIsSeparatedPortal();
+    void updateIsDescendentOfSeparatedPortal();
 #endif
+#endif
 
     enum StructuralLayerPurpose {
         NoStructuralLayer = 0,
@@ -563,7 +574,11 @@
 #endif
 #if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
         SeparatedChanged                        = 1LLU << 42,
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+        SeparatedPortalChanged                  = 1LLU << 43,
+        DescendentOfSeparatedPortalChanged      = 1LLU << 44,
 #endif
+#endif
     };
     typedef uint64_t LayerChangeFlags;
     void addUncommittedChanges(LayerChangeFlags);

Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h (278216 => 278217)


--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h	2021-05-28 18:47:39 UTC (rev 278216)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h	2021-05-28 18:54:27 UTC (rev 278217)
@@ -252,8 +252,16 @@
 
 #if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
     virtual bool isSeparated() const = 0;
-    virtual void setSeparated(bool) = 0;
+    virtual void setIsSeparated(bool) = 0;
+    
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+    virtual bool isSeparatedPortal() const = 0;
+    virtual void setIsSeparatedPortal(bool) = 0;
+
+    virtual bool isDescendentOfSeparatedPortal() const = 0;
+    virtual void setIsDescendentOfSeparatedPortal(bool) = 0;
 #endif
+#endif
 
     virtual TiledBacking* tiledBacking() = 0;
 

Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h (278216 => 278217)


--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h	2021-05-28 18:47:39 UTC (rev 278216)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h	2021-05-28 18:54:27 UTC (rev 278217)
@@ -179,8 +179,16 @@
 
 #if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
     bool isSeparated() const override;
-    void setSeparated(bool) override;
+    void setIsSeparated(bool) override;
+
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+    bool isSeparatedPortal() const override;
+    void setIsSeparatedPortal(bool) override;
+
+    bool isDescendentOfSeparatedPortal() const override;
+    void setIsDescendentOfSeparatedPortal(bool) override;
 #endif
+#endif
 
     TiledBacking* tiledBacking() override;
 

Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm (278216 => 278217)


--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm	2021-05-28 18:47:39 UTC (rev 278216)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm	2021-05-28 18:54:27 UTC (rev 278217)
@@ -1072,13 +1072,37 @@
     return m_layer.get().isSeparated;
 }
 
-void PlatformCALayerCocoa::setSeparated(bool value)
+void PlatformCALayerCocoa::setIsSeparated(bool value)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS
     [m_layer setSeparated:value];
     END_BLOCK_OBJC_EXCEPTIONS
 }
+
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+bool PlatformCALayerCocoa::isSeparatedPortal() const
+{
+    ASSERT_NOT_REACHED();
+    return false;
+}
+
+void PlatformCALayerCocoa::setIsSeparatedPortal(bool)
+{
+    ASSERT_NOT_REACHED();
+}
+
+bool PlatformCALayerCocoa::isDescendentOfSeparatedPortal() const
+{
+    ASSERT_NOT_REACHED();
+    return false;
+}
+
+void PlatformCALayerCocoa::setIsDescendentOfSeparatedPortal(bool)
+{
+    ASSERT_NOT_REACHED();
+}
 #endif
+#endif
 
 static NSString *layerContentsFormat(bool acceleratesDrawing, bool wantsDeepColor, bool supportsSubpixelAntialiasedFonts)
 {

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (278216 => 278217)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2021-05-28 18:47:39 UTC (rev 278216)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2021-05-28 18:54:27 UTC (rev 278217)
@@ -1320,7 +1320,7 @@
 
 #if ENABLE(CSS_TRANSFORM_STYLE_OPTIMIZED_3D)
     // FIXME: Take ancestry into account and remove unnecessary structural layers.
-    m_graphicsLayer->setSeparated(style.transformStyle3D() == TransformStyle3D::Optimized3D);
+    m_graphicsLayer->setIsSeparated(style.transformStyle3D() == TransformStyle3D::Optimized3D);
 #endif
 
     // Compute renderer offset from primary graphics layer. Note that primaryGraphicsLayerRect is in parentGraphicsLayer's coordinate system which is not necessarily

Modified: trunk/Source/WebKit/ChangeLog (278216 => 278217)


--- trunk/Source/WebKit/ChangeLog	2021-05-28 18:47:39 UTC (rev 278216)
+++ trunk/Source/WebKit/ChangeLog	2021-05-28 18:54:27 UTC (rev 278217)
@@ -1,3 +1,35 @@
+2021-05-28  Sam Weinig  <wei...@apple.com>
+
+        Add stub implementation of CA separated portal bits for GraphicsLayer
+        https://bugs.webkit.org/show_bug.cgi?id=226343
+
+        Reviewed by Simon Fraser.
+
+        Plumbs isSeparatedPortal and isDescendentOfSeparatedPortal bits through GraphicsLayer.
+        Renames setSeparated to setIsSeparated for consistency.
+
+        Currently unused, but getting the bits in is big enough that its helpful
+        to land on its own.
+
+        * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
+        (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer):
+        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
+        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
+        (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
+        (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const):
+        (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
+        (WebKit::dumpChangedLayers):
+        (WebKit::RemoteLayerTreeTransaction::RemoteLayerTreeTransaction): Deleted.
+        (WebKit::RemoteLayerTreeTransaction::~RemoteLayerTreeTransaction): Deleted.
+        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
+        (WebKit::PlatformCALayerRemote::setIsSeparated):
+        (WebKit::PlatformCALayerRemote::isSeparatedPortal const):
+        (WebKit::PlatformCALayerRemote::setIsSeparatedPortal):
+        (WebKit::PlatformCALayerRemote::isDescendentOfSeparatedPortal const):
+        (WebKit::PlatformCALayerRemote::setIsDescendentOfSeparatedPortal):
+        (WebKit::PlatformCALayerRemote::setSeparated): Deleted.
+        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
+
 2021-05-28  Jer Noble  <jer.no...@apple.com>
 
         [Cocoa] HDR variants in HLS playlists not selected when screen is HDR

Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm (278216 => 278217)


--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm	2021-05-28 18:47:39 UTC (rev 278216)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm	2021-05-28 18:54:27 UTC (rev 278217)
@@ -280,7 +280,17 @@
         if (properties.isSeparated)
             configureSeparatedLayer(layer);
     }
+
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+    if (properties.changedProperties & RemoteLayerTreeTransaction::SeparatedPortalChanged) {
+        // FIXME: Implement SeparatedPortalChanged.
+    }
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::DescendentOfSeparatedPortalChanged) {
+        // FIXME: Implement DescendentOfSeparatedPortalChanged.
+    }
 #endif
+#endif
 }
 
 void RemoteLayerTreePropertyApplier::applyProperties(RemoteLayerTreeNode& node, RemoteLayerTreeHost* layerTreeHost, const RemoteLayerTreeTransaction::LayerProperties& properties, const RelatedLayerMap& relatedLayers, RemoteLayerBackingStore::LayerContentsType layerContentsType)

Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h (278216 => 278217)


--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h	2021-05-28 18:47:39 UTC (rev 278216)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h	2021-05-28 18:54:27 UTC (rev 278217)
@@ -56,47 +56,51 @@
     WTF_MAKE_FAST_ALLOCATED;
 public:
     enum LayerChange {
-        NameChanged                     = 1LLU << 1,
-        ChildrenChanged                 = 1LLU << 2,
-        PositionChanged                 = 1LLU << 3,
-        BoundsChanged                   = 1LLU << 4,
-        BackgroundColorChanged          = 1LLU << 5,
-        AnchorPointChanged              = 1LLU << 6,
-        BorderWidthChanged              = 1LLU << 7,
-        BorderColorChanged              = 1LLU << 8,
-        OpacityChanged                  = 1LLU << 9,
-        TransformChanged                = 1LLU << 10,
-        SublayerTransformChanged        = 1LLU << 11,
-        HiddenChanged                   = 1LLU << 12,
-        GeometryFlippedChanged          = 1LLU << 13,
-        DoubleSidedChanged              = 1LLU << 14,
-        MasksToBoundsChanged            = 1LLU << 15,
-        OpaqueChanged                   = 1LLU << 16,
-        ContentsHiddenChanged           = 1LLU << 17,
-        MaskLayerChanged                = 1LLU << 18,
-        ClonedContentsChanged           = 1LLU << 19,
-        ContentsRectChanged             = 1LLU << 20,
-        ContentsScaleChanged            = 1LLU << 21,
-        CornerRadiusChanged             = 1LLU << 22,
-        ShapeRoundedRectChanged         = 1LLU << 23,
-        ShapePathChanged                = 1LLU << 24,
-        MinificationFilterChanged       = 1LLU << 25,
-        MagnificationFilterChanged      = 1LLU << 26,
-        BlendModeChanged                = 1LLU << 27,
-        WindRuleChanged                 = 1LLU << 28,
-        SpeedChanged                    = 1LLU << 29,
-        TimeOffsetChanged               = 1LLU << 30,
-        BackingStoreChanged             = 1LLU << 31,
-        BackingStoreAttachmentChanged   = 1LLU << 32,
-        FiltersChanged                  = 1LLU << 33,
-        AnimationsChanged               = 1LLU << 34,
-        EdgeAntialiasingMaskChanged     = 1LLU << 35,
-        CustomAppearanceChanged         = 1LLU << 36,
-        UserInteractionEnabledChanged   = 1LLU << 37,
-        EventRegionChanged              = 1LLU << 38,
+        NameChanged                         = 1LLU << 1,
+        ChildrenChanged                     = 1LLU << 2,
+        PositionChanged                     = 1LLU << 3,
+        BoundsChanged                       = 1LLU << 4,
+        BackgroundColorChanged              = 1LLU << 5,
+        AnchorPointChanged                  = 1LLU << 6,
+        BorderWidthChanged                  = 1LLU << 7,
+        BorderColorChanged                  = 1LLU << 8,
+        OpacityChanged                      = 1LLU << 9,
+        TransformChanged                    = 1LLU << 10,
+        SublayerTransformChanged            = 1LLU << 11,
+        HiddenChanged                       = 1LLU << 12,
+        GeometryFlippedChanged              = 1LLU << 13,
+        DoubleSidedChanged                  = 1LLU << 14,
+        MasksToBoundsChanged                = 1LLU << 15,
+        OpaqueChanged                       = 1LLU << 16,
+        ContentsHiddenChanged               = 1LLU << 17,
+        MaskLayerChanged                    = 1LLU << 18,
+        ClonedContentsChanged               = 1LLU << 19,
+        ContentsRectChanged                 = 1LLU << 20,
+        ContentsScaleChanged                = 1LLU << 21,
+        CornerRadiusChanged                 = 1LLU << 22,
+        ShapeRoundedRectChanged             = 1LLU << 23,
+        ShapePathChanged                    = 1LLU << 24,
+        MinificationFilterChanged           = 1LLU << 25,
+        MagnificationFilterChanged          = 1LLU << 26,
+        BlendModeChanged                    = 1LLU << 27,
+        WindRuleChanged                     = 1LLU << 28,
+        SpeedChanged                        = 1LLU << 29,
+        TimeOffsetChanged                   = 1LLU << 30,
+        BackingStoreChanged                 = 1LLU << 31,
+        BackingStoreAttachmentChanged       = 1LLU << 32,
+        FiltersChanged                      = 1LLU << 33,
+        AnimationsChanged                   = 1LLU << 34,
+        EdgeAntialiasingMaskChanged         = 1LLU << 35,
+        CustomAppearanceChanged             = 1LLU << 36,
+        UserInteractionEnabledChanged       = 1LLU << 37,
+        EventRegionChanged                  = 1LLU << 38,
 #if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
-        SeparatedChanged                = 1LLU << 39,
+        SeparatedChanged                    = 1LLU << 39,
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+        SeparatedPortalChanged              = 1LLU << 40,
+        DescendentOfSeparatedPortalChanged  = 1LLU << 41,
 #endif
+#endif
     };
 
     struct LayerCreationProperties {
@@ -183,7 +187,11 @@
         WebCore::EventRegion eventRegion;
 #if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
         bool isSeparated;
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+        bool isSeparatedPortal;
+        bool isDescendentOfSeparatedPortal;
 #endif
+#endif
     };
 
     explicit RemoteLayerTreeTransaction();
@@ -388,7 +396,11 @@
         WebKit::RemoteLayerTreeTransaction::LayerChange::EventRegionChanged
 #if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
         , WebKit::RemoteLayerTreeTransaction::LayerChange::SeparatedChanged
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+        , WebKit::RemoteLayerTreeTransaction::LayerChange::SeparatedPortalChanged
+        , WebKit::RemoteLayerTreeTransaction::LayerChange::DescendentOfSeparatedPortalChanged
 #endif
+#endif
     >;
 };
 

Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm (278216 => 278217)


--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm	2021-05-28 18:47:39 UTC (rev 278216)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm	2021-05-28 18:54:27 UTC (rev 278217)
@@ -129,7 +129,11 @@
     , userInteractionEnabled(true)
 #if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
     , isSeparated(false)
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+    , isSeparatedPortal(false)
+    , isDescendentOfSeparatedPortal(false)
 #endif
+#endif
 {
 }
 
@@ -171,7 +175,11 @@
     , eventRegion(other.eventRegion)
 #if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
     , isSeparated(other.isSeparated)
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+    , isSeparatedPortal(other.isSeparatedPortal)
+    , isDescendentOfSeparatedPortal(other.isDescendentOfSeparatedPortal)
 #endif
+#endif
 {
     // FIXME: LayerProperties should reference backing store by ID, so that two layers can have the same backing store (for clones).
     // FIXME: LayerProperties shouldn't be copyable; PlatformCALayerRemote::clone should copy the relevant properties.
@@ -313,7 +321,15 @@
 #if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
     if (changedProperties & SeparatedChanged)
         encoder << isSeparated;
+
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+    if (changedProperties & SeparatedPortalChanged)
+        encoder << isSeparatedPortal;
+
+    if (changedProperties & DescendentOfSeparatedPortalChanged)
+        encoder << isDescendentOfSeparatedPortal;
 #endif
+#endif
 }
 
 bool RemoteLayerTreeTransaction::LayerProperties::decode(IPC::Decoder& decoder, LayerProperties& result)
@@ -550,19 +566,26 @@
         if (!decoder.decode(result.isSeparated))
             return false;
     }
+
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+    if (result.changedProperties & SeparatedPortalChanged) {
+        if (!decoder.decode(result.isSeparatedPortal))
+            return false;
+    }
+
+    if (result.changedProperties & DescendentOfSeparatedPortalChanged) {
+        if (!decoder.decode(result.isDescendentOfSeparatedPortal))
+            return false;
+    }
 #endif
+#endif
 
     return true;
 }
 
-RemoteLayerTreeTransaction::RemoteLayerTreeTransaction()
-{
-}
+RemoteLayerTreeTransaction::RemoteLayerTreeTransaction() = default;
+RemoteLayerTreeTransaction::~RemoteLayerTreeTransaction() = default;
 
-RemoteLayerTreeTransaction::~RemoteLayerTreeTransaction()
-{
-}
-
 void RemoteLayerTreeTransaction::encode(IPC::Encoder& encoder) const
 {
     encoder << m_rootLayerID;
@@ -952,7 +975,15 @@
 #if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
         if (layerProperties.changedProperties & RemoteLayerTreeTransaction::SeparatedChanged)
             ts.dumpProperty("isSeparated", layerProperties.isSeparated);
+
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+        if (layerProperties.changedProperties & RemoteLayerTreeTransaction::SeparatedPortalChanged)
+            ts.dumpProperty("isSeparatedPortal", layerProperties.isSeparatedPortal);
+
+        if (layerProperties.changedProperties & RemoteLayerTreeTransaction::DescendentOfSeparatedPortalChanged)
+            ts.dumpProperty("isDescendentOfSeparatedPortal", layerProperties.isDescendentOfSeparatedPortal);
 #endif
+#endif
     }
 }
 

Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp (278216 => 278217)


--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp	2021-05-28 18:47:39 UTC (rev 278216)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp	2021-05-28 18:54:27 UTC (rev 278217)
@@ -893,7 +893,7 @@
     return m_properties.isSeparated;
 }
 
-void PlatformCALayerRemote::setSeparated(bool value)
+void PlatformCALayerRemote::setIsSeparated(bool value)
 {
     if (m_properties.isSeparated == value)
         return;
@@ -901,7 +901,37 @@
     m_properties.isSeparated = value;
     m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::SeparatedChanged);
 }
+
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+bool PlatformCALayerRemote::isSeparatedPortal() const
+{
+    return m_properties.isSeparatedPortal;
+}
+
+void PlatformCALayerRemote::setIsSeparatedPortal(bool value)
+{
+    if (m_properties.isSeparatedPortal == value)
+        return;
+
+    m_properties.isSeparatedPortal = value;
+    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::SeparatedPortalChanged);
+}
+
+bool PlatformCALayerRemote::isDescendentOfSeparatedPortal() const
+{
+    return m_properties.isDescendentOfSeparatedPortal;
+}
+
+void PlatformCALayerRemote::setIsDescendentOfSeparatedPortal(bool value)
+{
+    if (m_properties.isDescendentOfSeparatedPortal == value)
+        return;
+
+    m_properties.isDescendentOfSeparatedPortal = value;
+    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::DescendentOfSeparatedPortalChanged);
+}
 #endif
+#endif
 
 Ref<PlatformCALayer> PlatformCALayerRemote::createCompatibleLayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* client) const
 {

Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h (278216 => 278217)


--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h	2021-05-28 18:47:39 UTC (rev 278216)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h	2021-05-28 18:54:27 UTC (rev 278217)
@@ -181,8 +181,16 @@
 
 #if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
     bool isSeparated() const override;
-    void setSeparated(bool) override;
+    void setIsSeparated(bool) override;
+
+#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
+    bool isSeparatedPortal() const override;
+    void setIsSeparatedPortal(bool) override;
+
+    bool isDescendentOfSeparatedPortal() const override;
+    void setIsDescendentOfSeparatedPortal(bool) override;
 #endif
+#endif
 
     WebCore::TiledBacking* tiledBacking() override { return nullptr; }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to