diff options
author | Huang Dongsung <luxtella@company100.net> | 2013-04-12 16:33:09 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-12 16:43:37 +0200 |
commit | eb4a7e2599160b21b58e5a4baa8962886faab4ca (patch) | |
tree | a4eef89f389d0daab00a7a4db40cbb044d343db3 /Source/WebKit2/UIProcess | |
parent | 5787a3739981f95013735f9278b67a2b011f5b46 (diff) | |
download | qtwebkit-eb4a7e2599160b21b58e5a4baa8962886faab4ca.tar.gz |
Coordinated Graphics: a long page is scaled vertically while loading.
https://bugs.webkit.org/show_bug.cgi?id=109645
Backported from http://trac.webkit.org/changeset/142837
Reviewed by Noam Rosenthal.
When loading http://www.w3.org/TR/xpath-datamodel/, Coordinated Graphics draws
vertically scaled contents. It is because there is the difference between the
size of a layer and the size of CoordinatedBackingStore.
Currently, LayerTreeRenderer notifies the size to CoordinatedBackingStore
at the moment of creating, updating and removing a tile. However, it is not
necessary to send tile-related messages when the size of layer is changed.
So this patch resets the size of CoordinatedBackingStore when receiving the
message that is created when the size is changed: SyncLayerState.
There is no current way to reliably test flicker issues.
Change-Id: Ied0dfa7e333b0c7d89c33684b05ca9e1dfebd155
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'Source/WebKit2/UIProcess')
3 files changed, 10 insertions, 5 deletions
diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp b/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp index 4c0ced289..17c18bd1a 100644 --- a/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp +++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp @@ -106,7 +106,7 @@ PassRefPtr<BitmapTexture> CoordinatedBackingStore::texture() const void CoordinatedBackingStore::setSize(const WebCore::FloatSize& size) { - m_size = size; + m_pendingSize = size; } static bool shouldShowTileDebugVisuals() @@ -177,6 +177,11 @@ void CoordinatedBackingStore::paintToTextureMapper(TextureMapper* textureMapper, void CoordinatedBackingStore::commitTileOperations(TextureMapper* textureMapper) { HashSet<int>::iterator tilesToRemoveEnd = m_tilesToRemove.end(); + if (!m_pendingSize.isZero()) { + m_size = m_pendingSize; + m_pendingSize = FloatSize(); + } + for (HashSet<int>::iterator it = m_tilesToRemove.begin(); it != tilesToRemoveEnd; ++it) m_tiles.remove(*it); m_tilesToRemove.clear(); diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.h b/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.h index 4038a3724..3b747372d 100644 --- a/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.h +++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.h @@ -77,6 +77,8 @@ private: HashSet<int> m_tilesToRemove; WebCore::FloatSize m_size; float m_scale; + // FIXME: m_pendingSize should be removed after the following bug is fixed: https://bugs.webkit.org/show_bug.cgi?id=108294 + WebCore::FloatSize m_pendingSize; }; } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp index 0e88379bf..6ed1b12fd 100644 --- a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp +++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp @@ -427,6 +427,7 @@ void LayerTreeRenderer::prepareContentBackingStore(GraphicsLayer* graphicsLayer) } createBackingStoreIfNeeded(graphicsLayer); + resetBackingStoreSizeToLayerSize(graphicsLayer); } void LayerTreeRenderer::createBackingStoreIfNeeded(GraphicsLayer* graphicsLayer) @@ -448,7 +449,6 @@ void LayerTreeRenderer::createBackingStoreIfNeeded(GraphicsLayer* graphicsLayer) return; // The layer already has a backing store (and no pending removal). RefPtr<CoordinatedBackingStore> backingStore(CoordinatedBackingStore::create()); - backingStore->setSize(graphicsLayer->size()); ASSERT(!m_pendingSyncBackingStores.contains(layer)); m_pendingSyncBackingStores.add(layer, backingStore); } @@ -481,6 +481,7 @@ void LayerTreeRenderer::resetBackingStoreSizeToLayerSize(GraphicsLayer* graphics CoordinatedBackingStore* backingStore = getBackingStore(graphicsLayer); ASSERT(backingStore); backingStore->setSize(graphicsLayer->size()); + m_backingStoresWithPendingBuffers.add(backingStore); } void LayerTreeRenderer::createTile(WebLayerID layerID, int tileID, float scale) @@ -490,7 +491,6 @@ void LayerTreeRenderer::createTile(WebLayerID layerID, int tileID, float scale) CoordinatedBackingStore* backingStore = getBackingStore(layer); ASSERT(backingStore); backingStore->createTile(tileID, scale); - resetBackingStoreSizeToLayerSize(layer); } void LayerTreeRenderer::removeTile(WebLayerID layerID, int tileID) @@ -502,7 +502,6 @@ void LayerTreeRenderer::removeTile(WebLayerID layerID, int tileID) return; backingStore->removeTile(tileID); - resetBackingStoreSizeToLayerSize(layer); m_backingStoresWithPendingBuffers.add(backingStore); } @@ -513,7 +512,6 @@ void LayerTreeRenderer::updateTile(WebLayerID layerID, int tileID, const TileUpd RefPtr<CoordinatedBackingStore> backingStore = getBackingStore(layer); ASSERT(backingStore); backingStore->updateTile(tileID, update.sourceRect, update.tileRect, update.surface, update.offset); - resetBackingStoreSizeToLayerSize(layer); m_backingStoresWithPendingBuffers.add(backingStore); } |