Title: [235217] trunk/Source
Revision
235217
Author
zandober...@gmail.com
Date
2018-08-22 23:20:14 -0700 (Wed, 22 Aug 2018)

Log Message

[CoordGraphics] Remove CoordinatedImageBacking and related functionality
https://bugs.webkit.org/show_bug.cgi?id=188847

Reviewed by Michael Catanzaro.

Remove the CoordinatedImageBacking class and its intertwining use in the
CoordinatedGraphics system.

Source/WebCore:

Remove the now-unused m_coordinatedImageBacking member variable from the
CoordinatedGraphicsLayer class, along with CoordinatedImageBacking::Host
inheritance. Various related helper methods are also removed.

In CoordinatedGraphicsState and CoordinatedGraphicsLayerState classes,
we are able to drop different CoordinatedImageBacking-related state
values that are not used anymore.

* platform/TextureMapper.cmake:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::setContentsToImage):
(WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
(WebCore::CoordinatedGraphicsLayer::didChangeImageBacking): Deleted.
(WebCore::CoordinatedGraphicsLayer::syncImageBacking): Deleted.
(WebCore::CoordinatedGraphicsLayer::imageBackingVisible): Deleted.
(WebCore::CoordinatedGraphicsLayer::releaseImageBackingIfNeeded): Deleted.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
(WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
* platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp: Removed.
* platform/graphics/texmap/coordinated/CoordinatedImageBacking.h: Removed.

Source/WebKit:

Drop the CoordinatedImageBacking object management from the
CompositingCoordinator class, along with the
CoordinatedImageBacking::Client inheritance. The corresponding image
backing state management on the CoordinatedGraphicsState class can be
removed accordingly.

* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::flushPendingLayerChanges):
(WebKit::CompositingCoordinator::clearPendingStateChanges):
(WebKit::CompositingCoordinator::purgeBackingStores):
(WebKit::CompositingCoordinator::createImageBackingIfNeeded): Deleted.
(WebKit::CompositingCoordinator::createImageBacking): Deleted.
(WebKit::CompositingCoordinator::updateImageBacking): Deleted.
(WebKit::CompositingCoordinator::clearImageBackingContents): Deleted.
(WebKit::CompositingCoordinator::removeImageBacking): Deleted.
(WebKit::CompositingCoordinator::flushPendingImageBackingChanges): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (235216 => 235217)


--- trunk/Source/WebCore/ChangeLog	2018-08-23 05:52:57 UTC (rev 235216)
+++ trunk/Source/WebCore/ChangeLog	2018-08-23 06:20:14 UTC (rev 235217)
@@ -1,3 +1,37 @@
+2018-08-22  Zan Dobersek  <zdober...@igalia.com>
+
+        [CoordGraphics] Remove CoordinatedImageBacking and related functionality
+        https://bugs.webkit.org/show_bug.cgi?id=188847
+
+        Reviewed by Michael Catanzaro.
+
+        Remove the CoordinatedImageBacking class and its intertwining use in the
+        CoordinatedGraphics system.
+
+        Remove the now-unused m_coordinatedImageBacking member variable from the
+        CoordinatedGraphicsLayer class, along with CoordinatedImageBacking::Host
+        inheritance. Various related helper methods are also removed.
+
+        In CoordinatedGraphicsState and CoordinatedGraphicsLayerState classes,
+        we are able to drop different CoordinatedImageBacking-related state
+        values that are not used anymore.
+
+        * platform/TextureMapper.cmake:
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
+        (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
+        (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
+        (WebCore::CoordinatedGraphicsLayer::setContentsToImage):
+        (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
+        (WebCore::CoordinatedGraphicsLayer::didChangeImageBacking): Deleted.
+        (WebCore::CoordinatedGraphicsLayer::syncImageBacking): Deleted.
+        (WebCore::CoordinatedGraphicsLayer::imageBackingVisible): Deleted.
+        (WebCore::CoordinatedGraphicsLayer::releaseImageBackingIfNeeded): Deleted.
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
+        (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
+        * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp: Removed.
+        * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h: Removed.
+
 2018-08-22  Ryosuke Niwa  <rn...@webkit.org>
 
         Store RefPtr in FocusNavigationScope

Modified: trunk/Source/WebCore/platform/TextureMapper.cmake (235216 => 235217)


--- trunk/Source/WebCore/platform/TextureMapper.cmake	2018-08-23 05:52:57 UTC (rev 235216)
+++ trunk/Source/WebCore/platform/TextureMapper.cmake	2018-08-23 06:20:14 UTC (rev 235217)
@@ -35,7 +35,6 @@
 
         platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp
         platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
-        platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp
         platform/graphics/texmap/coordinated/Tile.cpp
         platform/graphics/texmap/coordinated/TiledBackingStore.cpp
     )

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp (235216 => 235217)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp	2018-08-23 05:52:57 UTC (rev 235216)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp	2018-08-23 06:20:14 UTC (rev 235217)
@@ -93,12 +93,6 @@
     notifyFlushRequired();
 }
 
-void CoordinatedGraphicsLayer::didChangeImageBacking()
-{
-    m_shouldSyncImageBacking = true;
-    notifyFlushRequired();
-}
-
 void CoordinatedGraphicsLayer::didUpdateTileBuffers()
 {
     if (!isShowingRepaintCounter())
@@ -135,7 +129,6 @@
     , m_shouldSyncLayerState(true)
     , m_shouldSyncChildren(true)
     , m_shouldSyncFilters(true)
-    , m_shouldSyncImageBacking(true)
     , m_shouldSyncAnimations(true)
     , m_movingVisibleRect(false)
     , m_pendingContentsScaleAdjustment(false)
@@ -162,7 +155,6 @@
         purgeBackingStores();
         m_coordinator->detachLayer(this);
     }
-    ASSERT(!m_coordinatedImageBacking);
     ASSERT(!m_mainBackingStore);
     ASSERT(!m_nicosia.imageBacking);
     ASSERT(!m_nicosia.backingStore);
@@ -544,7 +536,7 @@
     m_compositedNativeImagePtr = nativeImagePtr;
 
     GraphicsLayer::setContentsToImage(image);
-    didChangeImageBacking();
+    notifyFlushRequired();
 }
 
 void CoordinatedGraphicsLayer::setMaskLayer(GraphicsLayer* layer)
@@ -670,32 +662,6 @@
     m_nicosia.delta.filtersChanged = true;
 }
 
-void CoordinatedGraphicsLayer::syncImageBacking()
-{
-    if (!m_shouldSyncImageBacking)
-        return;
-    m_shouldSyncImageBacking = false;
-
-    if (m_compositedNativeImagePtr) {
-        ASSERT(!shouldHaveBackingStore());
-        ASSERT(m_compositedImage);
-
-        bool imageInstanceReplaced = m_coordinatedImageBacking && (m_coordinatedImageBacking->id() != CoordinatedImageBacking::getCoordinatedImageBackingID(*m_compositedImage));
-        if (imageInstanceReplaced)
-            releaseImageBackingIfNeeded();
-
-        if (!m_coordinatedImageBacking) {
-            m_coordinatedImageBacking = m_coordinator->createImageBackingIfNeeded(*m_compositedImage);
-            m_coordinatedImageBacking->addHost(*this);
-            m_layerState.imageID = m_coordinatedImageBacking->id();
-        }
-
-        m_coordinatedImageBacking->markDirty();
-        m_layerState.imageChanged = true;
-    } else
-        releaseImageBackingIfNeeded();
-}
-
 void CoordinatedGraphicsLayer::syncLayerState()
 {
     if (!m_shouldSyncLayerState)
@@ -989,24 +955,6 @@
     m_layerState.tilesToUpdate.clear();
 }
 
-bool CoordinatedGraphicsLayer::imageBackingVisible()
-{
-    ASSERT(m_coordinatedImageBacking);
-    return transformedVisibleRect().intersects(IntRect(contentsRect()));
-}
-
-void CoordinatedGraphicsLayer::releaseImageBackingIfNeeded()
-{
-    if (!m_coordinatedImageBacking)
-        return;
-
-    ASSERT(m_coordinator);
-    m_coordinatedImageBacking->removeHost(*this);
-    m_coordinatedImageBacking = nullptr;
-    m_layerState.imageID = InvalidCoordinatedImageBackingID;
-    m_layerState.imageChanged = true;
-}
-
 void CoordinatedGraphicsLayer::deviceOrPageScaleFactorChanged()
 {
     if (shouldHaveBackingStore())
@@ -1224,8 +1172,6 @@
         m_nicosia.backingStore = nullptr;
     }
 
-    releaseImageBackingIfNeeded();
-
     didChangeLayerState();
 }
 

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h (235216 => 235217)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h	2018-08-23 05:52:57 UTC (rev 235216)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h	2018-08-23 06:20:14 UTC (rev 235217)
@@ -24,7 +24,6 @@
 #if USE(COORDINATED_GRAPHICS)
 
 #include "CoordinatedGraphicsState.h"
-#include "CoordinatedImageBacking.h"
 #include "FloatPoint3D.h"
 #include "GraphicsLayer.h"
 #include "GraphicsLayerTransform.h"
@@ -50,7 +49,6 @@
 public:
     virtual bool isFlushingLayerChanges() const = 0;
     virtual FloatRect visibleContentsRect() const = 0;
-    virtual Ref<CoordinatedImageBacking> createImageBackingIfNeeded(Image&) = 0;
     virtual void detachLayer(CoordinatedGraphicsLayer*) = 0;
     virtual void attachLayer(CoordinatedGraphicsLayer*) = 0;
     virtual Nicosia::PaintingEngine& paintingEngine() = 0;
@@ -59,8 +57,7 @@
 };
 
 class WEBCORE_EXPORT CoordinatedGraphicsLayer : public GraphicsLayer
-    , public TiledBackingStoreClient
-    , public CoordinatedImageBacking::Host {
+    , public TiledBackingStoreClient {
 public:
     explicit CoordinatedGraphicsLayer(Type, GraphicsLayerClient&);
     virtual ~CoordinatedGraphicsLayer();
@@ -149,7 +146,6 @@
     void didChangeGeometry();
     void didChangeChildren();
     void didChangeFilters();
-    void didChangeImageBacking();
     void didUpdateTileBuffers();
 
     void resetLayerState();
@@ -157,7 +153,6 @@
     void syncAnimations();
     void syncChildren();
     void syncFilters();
-    void syncImageBacking();
     void computeTransformedVisibleRect();
     void updateContentBuffers();
 
@@ -165,8 +160,6 @@
 
     void notifyFlushRequired();
 
-    // CoordinatedImageBacking::Host
-    bool imageBackingVisible() override;
     bool shouldHaveBackingStore() const;
     bool selfOrAncestorHasActiveTransformAnimation() const;
     bool selfOrAncestorHaveNonAffineTransforms();
@@ -196,7 +189,6 @@
     bool m_shouldSyncLayerState: 1;
     bool m_shouldSyncChildren: 1;
     bool m_shouldSyncFilters: 1;
-    bool m_shouldSyncImageBacking: 1;
     bool m_shouldSyncAnimations: 1;
     bool m_movingVisibleRect : 1;
     bool m_pendingContentsScaleAdjustment : 1;
@@ -217,7 +209,6 @@
 
     RefPtr<Image> m_compositedImage;
     NativeImagePtr m_compositedNativeImagePtr;
-    RefPtr<CoordinatedImageBacking> m_coordinatedImageBacking;
 
     PlatformLayer* m_platformLayer;
     Timer m_animationStartedTimer;

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h (235216 => 235217)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h	2018-08-23 05:52:57 UTC (rev 235216)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h	2018-08-23 06:20:14 UTC (rev 235217)
@@ -52,9 +52,6 @@
 typedef uint32_t CoordinatedLayerID;
 enum { InvalidCoordinatedLayerID = 0 };
 
-typedef uint64_t CoordinatedImageBackingID;
-enum { InvalidCoordinatedImageBackingID = 0 };
-
 struct TileUpdateInfo {
     uint32_t tileID;
     IntRect tileRect;
@@ -91,7 +88,6 @@
             bool debugVisualsChanged: 1;
             bool replicaChanged: 1;
             bool maskChanged: 1;
-            bool imageChanged: 1;
             bool flagsChanged: 1;
             bool animationsChanged: 1;
             bool filtersChanged: 1;
@@ -130,7 +126,6 @@
         , opacity(0)
         , replica(InvalidCoordinatedLayerID)
         , mask(InvalidCoordinatedLayerID)
-        , imageID(InvalidCoordinatedImageBackingID)
 #if USE(COORDINATED_GRAPHICS_THREADED)
         , platformLayerProxy(0)
 #endif
@@ -154,7 +149,6 @@
     Vector<uint32_t> tilesToRemove;
     CoordinatedLayerID replica;
     CoordinatedLayerID mask;
-    CoordinatedImageBackingID imageID;
     DebugVisuals debugVisuals;
     RepaintCount repaintCount;
 
@@ -180,11 +174,6 @@
     Vector<CoordinatedLayerID> layersToCreate;
     Vector<std::pair<CoordinatedLayerID, CoordinatedGraphicsLayerState>> layersToUpdate;
     Vector<CoordinatedLayerID> layersToRemove;
-
-    Vector<CoordinatedImageBackingID> imagesToCreate;
-    Vector<CoordinatedImageBackingID> imagesToRemove;
-    Vector<std::pair<CoordinatedImageBackingID, RefPtr<Nicosia::Buffer>>> imagesToUpdate;
-    Vector<CoordinatedImageBackingID> imagesToClear;
 };
 
 } // namespace WebCore

Deleted: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp (235216 => 235217)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp	2018-08-23 05:52:57 UTC (rev 235216)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp	2018-08-23 06:20:14 UTC (rev 235217)
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2012 Company 100, 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. AND ITS CONTRIBUTORS ``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 ITS 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.
- */
-
-#include "config.h"
-#include "CoordinatedImageBacking.h"
-
-#if USE(COORDINATED_GRAPHICS)
-
-#include "CoordinatedGraphicsState.h"
-#include "GraphicsContext.h"
-#include "NicosiaBuffer.h"
-#include "NicosiaPaintingContext.h"
-
-namespace WebCore {
-
-CoordinatedImageBackingID CoordinatedImageBacking::getCoordinatedImageBackingID(Image& image)
-{
-    // CoordinatedImageBacking keeps a RefPtr<Image> member, so the same Image pointer can not refer two different instances until CoordinatedImageBacking releases the member.
-    return reinterpret_cast<CoordinatedImageBackingID>(&image);
-}
-
-CoordinatedImageBacking::CoordinatedImageBacking(Client& client, Ref<Image>&& image)
-    : m_client(client)
-    , m_id(getCoordinatedImageBackingID(image))
-    , m_image(WTFMove(image))
-    , m_clearContentsTimer(*this, &CoordinatedImageBacking::clearContentsTimerFired)
-{
-    m_client.createImageBacking(m_id);
-}
-
-CoordinatedImageBacking::~CoordinatedImageBacking() = default;
-
-void CoordinatedImageBacking::addHost(Host& host)
-{
-    ASSERT(!m_hosts.contains(&host));
-    m_hosts.add(&host);
-}
-
-void CoordinatedImageBacking::removeHost(Host& host)
-{
-    m_hosts.remove(&host);
-
-    if (m_hosts.isEmpty())
-        m_client.removeImageBacking(m_id);
-}
-
-static const Seconds clearContentsTimerInterval { 3_s };
-
-void CoordinatedImageBacking::update()
-{
-    bool previousIsVisible = m_isVisible;
-    m_isVisible = std::any_of(m_hosts.begin(), m_hosts.end(),
-        [](auto* host)
-        {
-            return host->imageBackingVisible();
-        });
-
-    if (!m_isVisible) {
-        if (previousIsVisible) {
-            ASSERT(!m_clearContentsTimer.isActive());
-            m_clearContentsTimer.startOneShot(clearContentsTimerInterval);
-        }
-        return;
-    }
-
-    bool changedToVisible = !previousIsVisible;
-    if (m_clearContentsTimer.isActive()) {
-        m_clearContentsTimer.stop();
-        // We don't want to update the texture if we didn't remove the texture.
-        changedToVisible = false;
-    }
-
-    auto nativeImagePtr = m_image->nativeImageForCurrentFrame();
-    if (!changedToVisible) {
-        if (!m_isDirty)
-            return;
-
-        if (m_nativeImagePtr == nativeImagePtr) {
-            m_isDirty = false;
-            return;
-        }
-    }
-
-    m_nativeImagePtr = WTFMove(nativeImagePtr);
-
-    auto buffer = Nicosia::Buffer::create(IntSize(m_image->size()), !m_image->currentFrameKnownToBeOpaque() ? Nicosia::Buffer::SupportsAlpha : Nicosia::Buffer::NoFlags);
-    Nicosia::PaintingContext::paint(buffer,
-        [this](GraphicsContext& context)
-        {
-            IntRect rect { { }, IntSize { m_image->size() } };
-            context.drawImage(m_image, rect, rect, ImagePaintingOptions(CompositeCopy));
-        });
-
-    m_client.updateImageBacking(m_id, WTFMove(buffer));
-    m_isDirty = false;
-}
-
-void CoordinatedImageBacking::clearContentsTimerFired()
-{
-    m_client.clearImageBackingContents(m_id);
-}
-
-} // namespace WebCore
-
-#endif

Deleted: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.h (235216 => 235217)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.h	2018-08-23 05:52:57 UTC (rev 235216)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.h	2018-08-23 06:20:14 UTC (rev 235217)
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2012 Company 100, 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. AND ITS CONTRIBUTORS ``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 ITS 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
-
-#if USE(COORDINATED_GRAPHICS)
-
-#include "CoordinatedGraphicsState.h"
-#include "Image.h"
-#include "Timer.h"
-#include <wtf/RefCounted.h>
-#include <wtf/Vector.h>
-
-namespace Nicosia {
-class Buffer;
-}
-
-namespace WebCore {
-
-class WEBCORE_EXPORT CoordinatedImageBacking : public RefCounted<CoordinatedImageBacking> {
-public:
-    class Client {
-    public:
-        virtual void createImageBacking(CoordinatedImageBackingID) = 0;
-        virtual void updateImageBacking(CoordinatedImageBackingID, RefPtr<Nicosia::Buffer>&&) = 0;
-        virtual void clearImageBackingContents(CoordinatedImageBackingID) = 0;
-        virtual void removeImageBacking(CoordinatedImageBackingID) = 0;
-    };
-
-    class Host {
-    public:
-        virtual bool imageBackingVisible() = 0;
-    };
-
-    static Ref<CoordinatedImageBacking> create(Client& client, Ref<Image>&& image)
-    {
-        return adoptRef(*new CoordinatedImageBacking(client, WTFMove(image)));
-    }
-    virtual ~CoordinatedImageBacking();
-
-    static CoordinatedImageBackingID getCoordinatedImageBackingID(Image&);
-    CoordinatedImageBackingID id() const { return m_id; }
-
-    void addHost(Host&);
-    void removeHost(Host&);
-
-    // When a new image is updated or an animated gif is progressed, CoordinatedGraphicsLayer calls markDirty().
-    void markDirty() { m_isDirty = true; }
-
-    // Create, remove or update its backing.
-    void update();
-
-private:
-    CoordinatedImageBacking(Client&, Ref<Image>&&);
-
-    void clearContentsTimerFired();
-
-    Client& m_client;
-    HashSet<Host*> m_hosts;
-
-    CoordinatedImageBackingID m_id;
-    Ref<Image> m_image;
-    NativeImagePtr m_nativeImagePtr;
-
-    Timer m_clearContentsTimer;
-
-    bool m_isDirty { false };
-    bool m_isVisible { false };
-};
-
-} // namespace WebCore
-
-#endif // USE(COORDINATED_GRAPHICS)

Modified: trunk/Source/WebKit/ChangeLog (235216 => 235217)


--- trunk/Source/WebKit/ChangeLog	2018-08-23 05:52:57 UTC (rev 235216)
+++ trunk/Source/WebKit/ChangeLog	2018-08-23 06:20:14 UTC (rev 235217)
@@ -1,3 +1,31 @@
+2018-08-22  Zan Dobersek  <zdober...@igalia.com>
+
+        [CoordGraphics] Remove CoordinatedImageBacking and related functionality
+        https://bugs.webkit.org/show_bug.cgi?id=188847
+
+        Reviewed by Michael Catanzaro.
+
+        Remove the CoordinatedImageBacking class and its intertwining use in the
+        CoordinatedGraphics system.
+
+        Drop the CoordinatedImageBacking object management from the
+        CompositingCoordinator class, along with the
+        CoordinatedImageBacking::Client inheritance. The corresponding image
+        backing state management on the CoordinatedGraphicsState class can be
+        removed accordingly.
+
+        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
+        (WebKit::CompositingCoordinator::flushPendingLayerChanges):
+        (WebKit::CompositingCoordinator::clearPendingStateChanges):
+        (WebKit::CompositingCoordinator::purgeBackingStores):
+        (WebKit::CompositingCoordinator::createImageBackingIfNeeded): Deleted.
+        (WebKit::CompositingCoordinator::createImageBacking): Deleted.
+        (WebKit::CompositingCoordinator::updateImageBacking): Deleted.
+        (WebKit::CompositingCoordinator::clearImageBackingContents): Deleted.
+        (WebKit::CompositingCoordinator::removeImageBacking): Deleted.
+        (WebKit::CompositingCoordinator::flushPendingImageBackingChanges): Deleted.
+        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
+
 2018-08-22  Sihui Liu  <sihui_...@apple.com>
 
         Move legacy directory configuration from WebProcessPool to API::WebsiteDataStore

Modified: trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp (235216 => 235217)


--- trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp	2018-08-23 05:52:57 UTC (rev 235216)
+++ trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp	2018-08-23 06:20:14 UTC (rev 235217)
@@ -125,8 +125,6 @@
     coordinatedLayer.updateContentBuffersIncludingSubLayers();
     coordinatedLayer.syncPendingStateChangesIncludingSubLayers();
 
-    flushPendingImageBackingChanges();
-
     if (m_shouldSyncFrame) {
         didSync = true;
 
@@ -196,11 +194,6 @@
     m_state.layersToCreate.clear();
     m_state.layersToUpdate.clear();
     m_state.layersToRemove.clear();
-
-    m_state.imagesToCreate.clear();
-    m_state.imagesToRemove.clear();
-    m_state.imagesToUpdate.clear();
-    m_state.imagesToClear.clear();
 }
 
 void CompositingCoordinator::initializeRootCompositingLayerIfNeeded()
@@ -233,53 +226,6 @@
     m_state.layersToUpdate.append(std::make_pair(id, state));
 }
 
-Ref<CoordinatedImageBacking> CompositingCoordinator::createImageBackingIfNeeded(Image& image)
-{
-    CoordinatedImageBackingID imageID = CoordinatedImageBacking::getCoordinatedImageBackingID(image);
-    auto addResult = m_imageBackings.ensure(imageID, [this, &image] {
-        return CoordinatedImageBacking::create(*this, image);
-    });
-    return *addResult.iterator->value;
-}
-
-void CompositingCoordinator::createImageBacking(CoordinatedImageBackingID imageID)
-{
-    m_state.imagesToCreate.append(imageID);
-}
-
-void CompositingCoordinator::updateImageBacking(CoordinatedImageBackingID imageID, RefPtr<Nicosia::Buffer>&& buffer)
-{
-    m_shouldSyncFrame = true;
-    m_state.imagesToUpdate.append(std::make_pair(imageID, WTFMove(buffer)));
-}
-
-void CompositingCoordinator::clearImageBackingContents(CoordinatedImageBackingID imageID)
-{
-    m_shouldSyncFrame = true;
-    m_state.imagesToClear.append(imageID);
-}
-
-void CompositingCoordinator::removeImageBacking(CoordinatedImageBackingID imageID)
-{
-    if (m_isPurging)
-        return;
-
-    ASSERT(m_imageBackings.contains(imageID));
-    m_imageBackings.remove(imageID);
-
-    m_state.imagesToRemove.append(imageID);
-
-    size_t imageIDPosition = m_state.imagesToClear.find(imageID);
-    if (imageIDPosition != notFound)
-        m_state.imagesToClear.remove(imageIDPosition);
-}
-
-void CompositingCoordinator::flushPendingImageBackingChanges()
-{
-    for (auto& imageBacking : m_imageBackings.values())
-        imageBacking->update();
-}
-
 void CompositingCoordinator::notifyFlushRequired(const GraphicsLayer*)
 {
     if (!m_isDestructing && !isFlushingLayerChanges())
@@ -374,8 +320,6 @@
 
     for (auto& registeredLayer : m_registeredLayers.values())
         registeredLayer->purgeBackingStores();
-
-    m_imageBackings.clear();
 }
 
 Nicosia::PaintingEngine& CompositingCoordinator::paintingEngine()

Modified: trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h (235216 => 235217)


--- trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h	2018-08-23 05:52:57 UTC (rev 235216)
+++ trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h	2018-08-23 06:20:14 UTC (rev 235217)
@@ -31,7 +31,6 @@
 
 #include <WebCore/CoordinatedGraphicsLayer.h>
 #include <WebCore/CoordinatedGraphicsState.h>
-#include <WebCore/CoordinatedImageBacking.h>
 #include <WebCore/FloatPoint.h>
 #include <WebCore/GraphicsLayerClient.h>
 #include <WebCore/GraphicsLayerFactory.h>
@@ -52,7 +51,6 @@
 
 class CompositingCoordinator final : public WebCore::GraphicsLayerClient
     , public WebCore::CoordinatedGraphicsLayerClient
-    , public WebCore::CoordinatedImageBacking::Client
     , public WebCore::GraphicsLayerFactory {
     WTF_MAKE_NONCOPYABLE(CompositingCoordinator);
 public:
@@ -95,16 +93,9 @@
     float deviceScaleFactor() const override;
     float pageScaleFactor() const override;
 
-    // CoordinatedImageBacking::Client
-    void createImageBacking(WebCore::CoordinatedImageBackingID) override;
-    void updateImageBacking(WebCore::CoordinatedImageBackingID, RefPtr<Nicosia::Buffer>&&) override;
-    void clearImageBackingContents(WebCore::CoordinatedImageBackingID) override;
-    void removeImageBacking(WebCore::CoordinatedImageBackingID) override;
-
     // CoordinatedGraphicsLayerClient
     bool isFlushingLayerChanges() const override { return m_isFlushingLayerChanges; }
     WebCore::FloatRect visibleContentsRect() const override;
-    Ref<WebCore::CoordinatedImageBacking> createImageBackingIfNeeded(WebCore::Image&) override;
     void detachLayer(WebCore::CoordinatedGraphicsLayer*) override;
     void attachLayer(WebCore::CoordinatedGraphicsLayer*) override;
     Nicosia::PaintingEngine& paintingEngine() override;
@@ -114,7 +105,6 @@
     std::unique_ptr<WebCore::GraphicsLayer> createGraphicsLayer(WebCore::GraphicsLayer::Type, WebCore::GraphicsLayerClient&) override;
 
     void initializeRootCompositingLayerIfNeeded();
-    void flushPendingImageBackingChanges();
     void clearPendingStateChanges();
 
     void purgeBackingStores();
@@ -135,7 +125,6 @@
     WebCore::CoordinatedGraphicsState m_state;
 
     HashMap<WebCore::CoordinatedLayerID, WebCore::CoordinatedGraphicsLayer*> m_registeredLayers;
-    HashMap<WebCore::CoordinatedImageBackingID, RefPtr<WebCore::CoordinatedImageBacking>> m_imageBackings;
 
     std::unique_ptr<Nicosia::PaintingEngine> m_paintingEngine;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to