WebKit Bugzilla
Attachment 347797 Details for
Bug 188847
: [CoordGraphics] Remove CoordinatedImageBacking and related functionality
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188847-20180822174631.patch (text/plain), 27.42 KB, created by
Zan Dobersek
on 2018-08-22 08:46:32 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Zan Dobersek
Created:
2018-08-22 08:46:32 PDT
Size:
27.42 KB
patch
obsolete
>Subversion Revision: 235165 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 10922dc9633b88dd43b463f74641a3cbb52852c1..287e7ca0adf8859e6bede25ab235408a3a2e4471 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,37 @@ >+2018-08-22 Zan Dobersek <zdobersek@igalia.com> >+ >+ [CoordGraphics] Remove CoordinatedImageBacking and related functionality >+ https://bugs.webkit.org/show_bug.cgi?id=188847 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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 Zan Dobersek <zdobersek@igalia.com> > > [CoordGraphics] Switch to Nicosia::CompositionLayer state tracking >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 1e55404ed4cb65ed837f77c4275bc6ce92c4e6a1..38223551bca15859871f510b999138346dfb69e7 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,31 @@ >+2018-08-22 Zan Dobersek <zdobersek@igalia.com> >+ >+ [CoordGraphics] Remove CoordinatedImageBacking and related functionality >+ https://bugs.webkit.org/show_bug.cgi?id=188847 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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 Zan Dobersek <zdobersek@igalia.com> > > [CoordGraphics] Switch to Nicosia::CompositionLayer state tracking >diff --git a/Source/WebCore/platform/TextureMapper.cmake b/Source/WebCore/platform/TextureMapper.cmake >index 4b49962360a9f3ad4b9b2240de03dcea7c827495..bfe44f9242acd7a80c80f1135d3e063199e82da7 100644 >--- a/Source/WebCore/platform/TextureMapper.cmake >+++ b/Source/WebCore/platform/TextureMapper.cmake >@@ -35,7 +35,6 @@ if (USE_COORDINATED_GRAPHICS) > > 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 > ) >diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp >index 59db0f592ad8bb9496412fb9846fdb6cce3f81e6..7c6164294e0535239ec9d57f49a8660320c605f0 100644 >--- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp >+++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp >@@ -93,12 +93,6 @@ void CoordinatedGraphicsLayer::didChangeFilters() > notifyFlushRequired(); > } > >-void CoordinatedGraphicsLayer::didChangeImageBacking() >-{ >- m_shouldSyncImageBacking = true; >- notifyFlushRequired(); >-} >- > void CoordinatedGraphicsLayer::didUpdateTileBuffers() > { > if (!isShowingRepaintCounter()) >@@ -135,7 +129,6 @@ CoordinatedGraphicsLayer::CoordinatedGraphicsLayer(Type layerType, GraphicsLayer > , 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 @@ CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer() > purgeBackingStores(); > m_coordinator->detachLayer(this); > } >- ASSERT(!m_coordinatedImageBacking); > ASSERT(!m_mainBackingStore); > ASSERT(!m_nicosia.imageBacking); > ASSERT(!m_nicosia.backingStore); >@@ -544,7 +536,7 @@ void CoordinatedGraphicsLayer::setContentsToImage(Image* image) > m_compositedNativeImagePtr = nativeImagePtr; > > GraphicsLayer::setContentsToImage(image); >- didChangeImageBacking(); >+ notifyFlushRequired(); > } > > void CoordinatedGraphicsLayer::setMaskLayer(GraphicsLayer* layer) >@@ -670,32 +662,6 @@ void CoordinatedGraphicsLayer::syncFilters() > 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 @@ void CoordinatedGraphicsLayer::resetLayerState() > 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 @@ void CoordinatedGraphicsLayer::purgeBackingStores() > m_nicosia.backingStore = nullptr; > } > >- releaseImageBackingIfNeeded(); >- > didChangeLayerState(); > } > >diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h >index 7d6b66db3d2e19adc3e66c3da947112b8c894746..b4cbef4a70be7b4dd35cc8c5a6afd50cad115c63 100644 >--- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h >+++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h >@@ -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 @@ class CoordinatedGraphicsLayerClient { > 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 @@ public: > }; > > class WEBCORE_EXPORT CoordinatedGraphicsLayer : public GraphicsLayer >- , public TiledBackingStoreClient >- , public CoordinatedImageBacking::Host { >+ , public TiledBackingStoreClient { > public: > explicit CoordinatedGraphicsLayer(Type, GraphicsLayerClient&); > virtual ~CoordinatedGraphicsLayer(); >@@ -149,7 +146,6 @@ private: > void didChangeGeometry(); > void didChangeChildren(); > void didChangeFilters(); >- void didChangeImageBacking(); > void didUpdateTileBuffers(); > > void resetLayerState(); >@@ -157,7 +153,6 @@ private: > void syncAnimations(); > void syncChildren(); > void syncFilters(); >- void syncImageBacking(); > void computeTransformedVisibleRect(); > void updateContentBuffers(); > >@@ -165,8 +160,6 @@ private: > > void notifyFlushRequired(); > >- // CoordinatedImageBacking::Host >- bool imageBackingVisible() override; > bool shouldHaveBackingStore() const; > bool selfOrAncestorHasActiveTransformAnimation() const; > bool selfOrAncestorHaveNonAffineTransforms(); >@@ -196,7 +189,6 @@ private: > 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 @@ private: > > RefPtr<Image> m_compositedImage; > NativeImagePtr m_compositedNativeImagePtr; >- RefPtr<CoordinatedImageBacking> m_coordinatedImageBacking; > > PlatformLayer* m_platformLayer; > Timer m_animationStartedTimer; >diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h >index 6f9624f4e5d4b101c2ee611113e19d987b6e499b..ffcf284b9e93639f453b0e3a641569a5813dcd1f 100644 >--- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h >+++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h >@@ -52,9 +52,6 @@ namespace WebCore { > 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 @@ struct CoordinatedGraphicsLayerState { > 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 @@ struct CoordinatedGraphicsLayerState { > , opacity(0) > , replica(InvalidCoordinatedLayerID) > , mask(InvalidCoordinatedLayerID) >- , imageID(InvalidCoordinatedImageBackingID) > #if USE(COORDINATED_GRAPHICS_THREADED) > , platformLayerProxy(0) > #endif >@@ -154,7 +149,6 @@ struct CoordinatedGraphicsLayerState { > Vector<uint32_t> tilesToRemove; > CoordinatedLayerID replica; > CoordinatedLayerID mask; >- CoordinatedImageBackingID imageID; > DebugVisuals debugVisuals; > RepaintCount repaintCount; > >@@ -180,11 +174,6 @@ struct CoordinatedGraphicsState { > 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 >diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp >deleted file mode 100644 >index 258ba5a6a24aa582f9056a0b0f6c878e375e67fd..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp >+++ /dev/null >@@ -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 >diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.h b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.h >deleted file mode 100644 >index e4bd4398353c1b45ec7f087852c2a301527f0191..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.h >+++ /dev/null >@@ -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) >diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp >index 6ba95758c09d9d5a94d2e23ac2e891290b61d886..eb0a0e1f38e6c368d7dcbc3511eceb1c53392916 100644 >--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp >+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp >@@ -125,8 +125,6 @@ bool CompositingCoordinator::flushPendingLayerChanges() > coordinatedLayer.updateContentBuffersIncludingSubLayers(); > coordinatedLayer.syncPendingStateChangesIncludingSubLayers(); > >- flushPendingImageBackingChanges(); >- > if (m_shouldSyncFrame) { > didSync = true; > >@@ -196,11 +194,6 @@ void CompositingCoordinator::clearPendingStateChanges() > 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 @@ void CompositingCoordinator::syncLayerState(CoordinatedLayerID id, CoordinatedGr > 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 @@ void CompositingCoordinator::purgeBackingStores() > > for (auto& registeredLayer : m_registeredLayers.values()) > registeredLayer->purgeBackingStores(); >- >- m_imageBackings.clear(); > } > > Nicosia::PaintingEngine& CompositingCoordinator::paintingEngine() >diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h >index 4308eae2ff6207db56d06f554d3b85f8e8057e9c..987a91233f00699479cc9e139d322f663ba263a4 100644 >--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h >+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h >@@ -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 @@ namespace WebKit { > > 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 @@ private: > 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 @@ private: > std::unique_ptr<WebCore::GraphicsLayer> createGraphicsLayer(WebCore::GraphicsLayer::Type, WebCore::GraphicsLayerClient&) override; > > void initializeRootCompositingLayerIfNeeded(); >- void flushPendingImageBackingChanges(); > void clearPendingStateChanges(); > > void purgeBackingStores(); >@@ -135,7 +125,6 @@ private: > 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; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188847
: 347797