[CoordGraphics] Remove the 'previous backing store' logic
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Oct 2018 19:23:21 +0000 (19:23 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Oct 2018 19:23:21 +0000 (19:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188838

Patch by Carlos Eduardo Ramalho <cadubentzen@gmail.com> on 2018-10-09
Reviewed by Žan Doberšek.

Remove previousBackingStore from LayerState, since it's not needed anymore.
When there is scale adjustment, we now simply discard mainBackingStore and
recreate a new one.

No new tests required.

* platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
(WebCore::CoordinatedGraphicsLayer::purgeBackingStores):

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

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

index c57514e..bff2fe3 100644 (file)
@@ -1,3 +1,22 @@
+2018-10-09  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
+
+        [CoordGraphics] Remove the 'previous backing store' logic
+        https://bugs.webkit.org/show_bug.cgi?id=188838
+
+        Reviewed by Žan Doberšek.
+
+        Remove previousBackingStore from LayerState, since it's not needed anymore.
+        When there is scale adjustment, we now simply discard mainBackingStore and
+        recreate a new one.
+
+        No new tests required.
+
+        * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h:
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
+        (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
+        (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
+        (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
+
 2018-10-09  Antti Koivisto  <antti@apple.com>
 
         [PSON] Prewarm system UI font
index 16e1145..ead4977 100644 (file)
@@ -85,7 +85,6 @@ public:
         LayerState& operator=(LayerState&&) = delete;
 
         std::unique_ptr<WebCore::TiledBackingStore> mainBackingStore;
-        std::unique_ptr<WebCore::TiledBackingStore> previousBackingStore;
 
         TileUpdate update;
         bool isFlushing { false };
index 0f6ad65..15ae46f 100644 (file)
@@ -647,7 +647,6 @@ void CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly()
         auto& layerState = downcast<Nicosia::BackingStoreTextureMapperImpl>(m_nicosia.backingStore->impl()).layerState();
         layerState.isPurging = true;
         layerState.mainBackingStore = nullptr;
-        layerState.previousBackingStore = nullptr;
 
         m_nicosia.backingStore = nullptr;
         m_nicosia.delta.backingStoreChanged = true;
@@ -867,17 +866,10 @@ void CoordinatedGraphicsLayer::updateContentBuffers()
         };
 
     // Address the content scale adjustment.
-    // FIXME: the previousBackingStore logic is likely possible to remove.
-    // https://bugs.webkit.org/show_bug.cgi?id=188693
     if (m_pendingContentsScaleAdjustment) {
         if (layerState.mainBackingStore && layerState.mainBackingStore->contentsScale() != effectiveContentsScale()) {
-            // Between creating the new backing store and painting the content, we do not
-            // want to drop the previous one as that might result in briefly seeing flickering
-            // as the old tiles may be dropped before something replaces them.
-            layerState.previousBackingStore = WTFMove(layerState.mainBackingStore);
-
-            // No reason to save the previous backing store for non-visible areas.
-            layerState.previousBackingStore->removeAllNonVisibleTiles(transformedVisibleRect(), IntRect(0, 0, size().width(), size().height()));
+            // Discard the TiledBackingStore object to reconstruct it with new content scale.
+            layerState.mainBackingStore = nullptr;
         }
         m_pendingContentsScaleAdjustment = false;
     }
@@ -943,12 +935,6 @@ void CoordinatedGraphicsLayer::updateContentBuffers()
             didUpdateTileBuffers();
     }
 
-    // The previous backing store is kept around to avoid flickering between
-    // removing the existing tiles and painting the new ones. The first time
-    // the visibleRect is full painted we remove the previous backing store.
-    if (layerState.previousBackingStore && layerState.mainBackingStore->visibleAreaIsCovered())
-        layerState.previousBackingStore = nullptr;
-
     // Request a second update immediately if some tiles are still pending creation.
     if (layerState.hasPendingTileCreation) {
         setNeedsVisibleRectAdjustment();
@@ -967,7 +953,6 @@ void CoordinatedGraphicsLayer::purgeBackingStores()
         auto& layerState = downcast<Nicosia::BackingStoreTextureMapperImpl>(m_nicosia.backingStore->impl()).layerState();
         layerState.isPurging = true;
         layerState.mainBackingStore = nullptr;
-        layerState.previousBackingStore = nullptr;
 
         m_nicosia.backingStore = nullptr;
     }