[CoordGraphics] Drop old-school PlatformLayer management in CoordinatedGraphicsLayer
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Aug 2018 06:30:07 +0000 (06:30 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Aug 2018 06:30:07 +0000 (06:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188850

Reviewed by Michael Catanzaro.

Remove the m_platformLayer member from the CoordinatedGraphicsLayer
class as it's been unused since the rework in r235165.

The CoordinatedGraphicsLayer::syncPlatformLayer() helper method and the
related member variable can both be removed as well. On the
CoordinatedGraphicsLayerState class, we can remove the obsolete
flags and the TextureMapperPlatformLayerProxy member variable that's
unused now that such objects are handled through the Nicosia impl class.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
(WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
(WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
(WebCore::CoordinatedGraphicsLayer::syncPlatformLayer): Deleted.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
(WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235219 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h

index a62aabc..091094e 100644 (file)
@@ -1,5 +1,32 @@
 2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
 
+        [CoordGraphics] Drop old-school PlatformLayer management in CoordinatedGraphicsLayer
+        https://bugs.webkit.org/show_bug.cgi?id=188850
+
+        Reviewed by Michael Catanzaro.
+
+        Remove the m_platformLayer member from the CoordinatedGraphicsLayer
+        class as it's been unused since the rework in r235165.
+
+        The CoordinatedGraphicsLayer::syncPlatformLayer() helper method and the
+        related member variable can both be removed as well. On the
+        CoordinatedGraphicsLayerState class, we can remove the obsolete
+        flags and the TextureMapperPlatformLayerProxy member variable that's
+        unused now that such objects are handled through the Nicosia impl class.
+
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
+        (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
+        (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
+        (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
+        (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
+        (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
+        (WebCore::CoordinatedGraphicsLayer::syncPlatformLayer): Deleted.
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
+        (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
+
+2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
+
         [CoordGraphics] Remove TiledBackingStoreClient inheritance from CoordinatedGraphicsLayer
         https://bugs.webkit.org/show_bug.cgi?id=188849
 
index 876aec9..7f38fd9 100644 (file)
@@ -135,12 +135,10 @@ CoordinatedGraphicsLayer::CoordinatedGraphicsLayer(Type layerType, GraphicsLayer
     , m_pendingContentsScaleAdjustment(false)
     , m_pendingVisibleRectAdjustment(false)
 #if USE(COORDINATED_GRAPHICS_THREADED)
-    , m_shouldSyncPlatformLayer(false)
     , m_shouldUpdatePlatformLayer(false)
 #endif
     , m_coordinator(0)
     , m_compositedNativeImagePtr(0)
-    , m_platformLayer(0)
     , m_animationStartedTimer(*this, &CoordinatedGraphicsLayer::animationStartedTimerFired)
 {
     static CoordinatedLayerID nextLayerID = 1;
@@ -418,14 +416,9 @@ bool GraphicsLayer::supportsContentsTiling()
 
 void CoordinatedGraphicsLayer::setContentsNeedsDisplay()
 {
-#if USE(COORDINATED_GRAPHICS_THREADED)
-#if USE(NICOSIA)
+#if USE(COORDINATED_GRAPHICS_THREADED) && USE(NICOSIA)
     if (m_nicosia.contentLayer)
         m_shouldUpdatePlatformLayer = true;
-#else
-    if (m_platformLayer)
-        m_shouldUpdatePlatformLayer = true;
-#endif
 #endif
 
     notifyFlushRequired();
@@ -434,20 +427,12 @@ void CoordinatedGraphicsLayer::setContentsNeedsDisplay()
 
 void CoordinatedGraphicsLayer::setContentsToPlatformLayer(PlatformLayer* platformLayer, ContentsLayerPurpose)
 {
-#if USE(COORDINATED_GRAPHICS_THREADED)
-#if USE(NICOSIA)
+#if USE(COORDINATED_GRAPHICS_THREADED) && USE(NICOSIA)
     auto* contentLayer = downcast<Nicosia::ContentLayer>(platformLayer);
     if (m_nicosia.contentLayer != contentLayer) {
-        m_shouldSyncPlatformLayer = true;
         m_nicosia.contentLayer = contentLayer;
         m_nicosia.delta.contentLayerChanged = true;
     }
-#else
-    if (m_platformLayer != platformLayer)
-        m_shouldSyncPlatformLayer = true;
-
-    m_platformLayer = platformLayer;
-#endif
     notifyFlushRequired();
 #else
     UNUSED_PARAM(platformLayer);
@@ -726,37 +711,15 @@ void CoordinatedGraphicsLayer::syncAnimations()
     m_nicosia.delta.animationsChanged = true;
 }
 
-void CoordinatedGraphicsLayer::syncPlatformLayer()
-{
-    if (!m_shouldSyncPlatformLayer)
-        return;
-
-    m_shouldSyncPlatformLayer = false;
-#if USE(COORDINATED_GRAPHICS_THREADED)
-#if USE(NICOSIA)
-#else
-    m_layerState.platformLayerChanged = true;
-    if (m_platformLayer)
-        m_layerState.platformLayerProxy = m_platformLayer->proxy();
-#endif
-#endif
-}
-
 void CoordinatedGraphicsLayer::updatePlatformLayer()
 {
     if (!m_shouldUpdatePlatformLayer)
         return;
 
     m_shouldUpdatePlatformLayer = false;
-#if USE(COORDINATED_GRAPHICS_THREADED)
-#if USE(NICOSIA)
+#if USE(COORDINATED_GRAPHICS_THREADED) && USE(NICOSIA)
     if (m_nicosia.contentLayer)
         downcast<Nicosia::ContentLayerTextureMapperImpl>(m_nicosia.contentLayer->impl()).swapBuffersIfNeeded();
-#else
-    m_layerState.platformLayerUpdated = true;
-    if (m_platformLayer)
-        m_platformLayer->swapBuffersIfNeeded();
-#endif
 #endif
 }
 
@@ -779,7 +742,6 @@ void CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly()
     computeTransformedVisibleRect();
     syncChildren();
     syncFilters();
-    syncPlatformLayer();
     updatePlatformLayer();
 
     // Only unset m_movingVisibleRect after we have updated the visible rect after the animation stopped.
index 10a2d59..c0733ae 100644 (file)
@@ -104,7 +104,7 @@ public:
     void removeAnimation(const String&) override;
     void suspendAnimations(MonotonicTime) override;
     void resumeAnimations() override;
-    bool usesContentsLayer() const override { return m_platformLayer || m_nicosia.contentLayer || m_compositedImage; }
+    bool usesContentsLayer() const override { return m_nicosia.contentLayer || m_compositedImage; }
 
     void syncPendingStateChangesIncludingSubLayers();
     void updateContentBuffersIncludingSubLayers();
@@ -127,7 +127,6 @@ public:
 private:
     bool isCoordinatedGraphicsLayer() const override { return true; }
 
-    void syncPlatformLayer();
     void updatePlatformLayer();
 
     void setDebugBorder(const Color&, float width) override;
@@ -185,7 +184,6 @@ private:
     bool m_pendingContentsScaleAdjustment : 1;
     bool m_pendingVisibleRectAdjustment : 1;
 #if USE(COORDINATED_GRAPHICS_THREADED)
-    bool m_shouldSyncPlatformLayer : 1;
     bool m_shouldUpdatePlatformLayer : 1;
 #endif
 
@@ -199,7 +197,6 @@ private:
     RefPtr<Image> m_compositedImage;
     NativeImagePtr m_compositedNativeImagePtr;
 
-    PlatformLayer* m_platformLayer;
     Timer m_animationStartedTimer;
     TextureMapperAnimations m_animations;
     MonotonicTime m_lastAnimationStartTime;
index 9c2364a..6244a61 100644 (file)
 #include "TextureMapperAnimation.h"
 #include "TransformationMatrix.h"
 
-#if USE(COORDINATED_GRAPHICS_THREADED)
-#include "TextureMapperPlatformLayerProxy.h"
-#endif
-
 namespace WebCore {
 
 typedef uint32_t CoordinatedLayerID;
@@ -82,9 +78,6 @@ struct CoordinatedGraphicsLayerState {
             bool filtersChanged: 1;
             bool childrenChanged: 1;
             bool repaintCountChanged : 1;
-            bool platformLayerChanged: 1;
-            bool platformLayerUpdated: 1;
-            bool platformLayerShouldSwapBuffers: 1;
             bool isScrollableChanged: 1;
             bool contentsTilingChanged: 1;
         };
@@ -115,9 +108,6 @@ struct CoordinatedGraphicsLayerState {
         , opacity(0)
         , replica(InvalidCoordinatedLayerID)
         , mask(InvalidCoordinatedLayerID)
-#if USE(COORDINATED_GRAPHICS_THREADED)
-        , platformLayerProxy(0)
-#endif
     {
     }
 
@@ -139,10 +129,6 @@ struct CoordinatedGraphicsLayerState {
     DebugVisuals debugVisuals;
     RepaintCount repaintCount;
 
-#if USE(COORDINATED_GRAPHICS_THREADED)
-    RefPtr<TextureMapperPlatformLayerProxy> platformLayerProxy;
-#endif
-
     bool hasPendingChanges() const
     {
         return changeMask;