Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit fe5d901

Browse files
[CoordGraphics] Remove the 'previous backing store' logic
https://bugs.webkit.org/show_bug.cgi?id=188838 Patch by Carlos Eduardo Ramalho <[email protected]> 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: http://svn.webkit.org/repository/webkit/trunk@236974 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 3ed7f96 commit fe5d901

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

Source/WebCore/ChangeLog

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
2018-10-09 Carlos Eduardo Ramalho <[email protected]>
2+
3+
[CoordGraphics] Remove the 'previous backing store' logic
4+
https://bugs.webkit.org/show_bug.cgi?id=188838
5+
6+
Reviewed by Žan Doberšek.
7+
8+
Remove previousBackingStore from LayerState, since it's not needed anymore.
9+
When there is scale adjustment, we now simply discard mainBackingStore and
10+
recreate a new one.
11+
12+
No new tests required.
13+
14+
* platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h:
15+
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
16+
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
17+
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
18+
(WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
19+
120
2018-10-09 Antti Koivisto <[email protected]>
221

322
[PSON] Prewarm system UI font

Source/WebCore/platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ class BackingStoreTextureMapperImpl final : public BackingStore::Impl, public We
8585
LayerState& operator=(LayerState&&) = delete;
8686

8787
std::unique_ptr<WebCore::TiledBackingStore> mainBackingStore;
88-
std::unique_ptr<WebCore::TiledBackingStore> previousBackingStore;
8988

9089
TileUpdate update;
9190
bool isFlushing { false };

Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,6 @@ void CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly()
647647
auto& layerState = downcast<Nicosia::BackingStoreTextureMapperImpl>(m_nicosia.backingStore->impl()).layerState();
648648
layerState.isPurging = true;
649649
layerState.mainBackingStore = nullptr;
650-
layerState.previousBackingStore = nullptr;
651650

652651
m_nicosia.backingStore = nullptr;
653652
m_nicosia.delta.backingStoreChanged = true;
@@ -867,17 +866,10 @@ void CoordinatedGraphicsLayer::updateContentBuffers()
867866
};
868867

869868
// Address the content scale adjustment.
870-
// FIXME: the previousBackingStore logic is likely possible to remove.
871-
// https://bugs.webkit.org/show_bug.cgi?id=188693
872869
if (m_pendingContentsScaleAdjustment) {
873870
if (layerState.mainBackingStore && layerState.mainBackingStore->contentsScale() != effectiveContentsScale()) {
874-
// Between creating the new backing store and painting the content, we do not
875-
// want to drop the previous one as that might result in briefly seeing flickering
876-
// as the old tiles may be dropped before something replaces them.
877-
layerState.previousBackingStore = WTFMove(layerState.mainBackingStore);
878-
879-
// No reason to save the previous backing store for non-visible areas.
880-
layerState.previousBackingStore->removeAllNonVisibleTiles(transformedVisibleRect(), IntRect(0, 0, size().width(), size().height()));
871+
// Discard the TiledBackingStore object to reconstruct it with new content scale.
872+
layerState.mainBackingStore = nullptr;
881873
}
882874
m_pendingContentsScaleAdjustment = false;
883875
}
@@ -943,12 +935,6 @@ void CoordinatedGraphicsLayer::updateContentBuffers()
943935
didUpdateTileBuffers();
944936
}
945937

946-
// The previous backing store is kept around to avoid flickering between
947-
// removing the existing tiles and painting the new ones. The first time
948-
// the visibleRect is full painted we remove the previous backing store.
949-
if (layerState.previousBackingStore && layerState.mainBackingStore->visibleAreaIsCovered())
950-
layerState.previousBackingStore = nullptr;
951-
952938
// Request a second update immediately if some tiles are still pending creation.
953939
if (layerState.hasPendingTileCreation) {
954940
setNeedsVisibleRectAdjustment();
@@ -967,7 +953,6 @@ void CoordinatedGraphicsLayer::purgeBackingStores()
967953
auto& layerState = downcast<Nicosia::BackingStoreTextureMapperImpl>(m_nicosia.backingStore->impl()).layerState();
968954
layerState.isPurging = true;
969955
layerState.mainBackingStore = nullptr;
970-
layerState.previousBackingStore = nullptr;
971956

972957
m_nicosia.backingStore = nullptr;
973958
}

0 commit comments

Comments
 (0)