Coordinated Graphics: a long page is scaled vertically while loading.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Feb 2013 01:56:52 +0000 (01:56 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Feb 2013 01:56:52 +0000 (01:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=109645

Patch by Huang Dongsung <luxtella@company100.net> on 2013-02-13
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, CoordinatedGraphicsScene 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.

* platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp:
  Add m_pendingSize to set m_size at the moment of flushing.
  After http://webkit.org/b/108294, m_pendingSize will be removed
  because the bug makes CoordinatedGraphicsScene execute all messages at
  the moment of flushing.
(WebCore::CoordinatedBackingStore::setSize):
(WebCore::CoordinatedBackingStore::commitTileOperations):
* platform/graphics/texmap/coordinated/CoordinatedBackingStore.h:
(CoordinatedBackingStore):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
(WebCore::CoordinatedGraphicsScene::prepareContentBackingStore):
(WebCore::CoordinatedGraphicsScene::createBackingStoreIfNeeded):
(WebCore::CoordinatedGraphicsScene::resetBackingStoreSizeToLayerSize):
(WebCore::CoordinatedGraphicsScene::createTile):
(WebCore::CoordinatedGraphicsScene::removeTile):
(WebCore::CoordinatedGraphicsScene::updateTile):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBackingStore.h
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp

index 9dd954f01f94f0880cf2c4e34d99b735fcb1044f..d8b720e49604f5fa28a860b0aa010e977d621af9 100644 (file)
@@ -1,3 +1,39 @@
+2013-02-13  Huang Dongsung  <luxtella@company100.net>
+
+        Coordinated Graphics: a long page is scaled vertically while loading.
+        https://bugs.webkit.org/show_bug.cgi?id=109645
+
+        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, CoordinatedGraphicsScene 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.
+
+        * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp:
+          Add m_pendingSize to set m_size at the moment of flushing.
+          After http://webkit.org/b/108294, m_pendingSize will be removed
+          because the bug makes CoordinatedGraphicsScene execute all messages at
+          the moment of flushing.
+        (WebCore::CoordinatedBackingStore::setSize):
+        (WebCore::CoordinatedBackingStore::commitTileOperations):
+        * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h:
+        (CoordinatedBackingStore):
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
+        (WebCore::CoordinatedGraphicsScene::prepareContentBackingStore):
+        (WebCore::CoordinatedGraphicsScene::createBackingStoreIfNeeded):
+        (WebCore::CoordinatedGraphicsScene::resetBackingStoreSizeToLayerSize):
+        (WebCore::CoordinatedGraphicsScene::createTile):
+        (WebCore::CoordinatedGraphicsScene::removeTile):
+        (WebCore::CoordinatedGraphicsScene::updateTile):
+
 2013-02-13  Kentaro Hara  <haraken@chromium.org>
 
         [V8] Rename XXXAccessorGetter() to XXXAttrGetterCustom(),
index 68129c73d2b60a864322c45f47b0e010d312d838..105c1cbfa55dbefefb32c36d85f733bbc6df3748 100644 (file)
@@ -103,7 +103,7 @@ PassRefPtr<BitmapTexture> CoordinatedBackingStore::texture() const
 
 void CoordinatedBackingStore::setSize(const FloatSize& size)
 {
-    m_size = size;
+    m_pendingSize = size;
 }
 
 void CoordinatedBackingStore::paintTilesToTextureMapper(Vector<TextureMapperTile*>& tiles, TextureMapper* textureMapper, const TransformationMatrix& transform, float opacity, BitmapTexture* mask, const FloatRect& rect)
@@ -174,6 +174,11 @@ void CoordinatedBackingStore::drawRepaintCounter(TextureMapper* textureMapper, i
 
 void CoordinatedBackingStore::commitTileOperations(TextureMapper* textureMapper)
 {
+    if (!m_pendingSize.isZero()) {
+        m_size = m_pendingSize;
+        m_pendingSize = FloatSize();
+    }
+
     HashSet<uint32_t>::iterator tilesToRemoveEnd = m_tilesToRemove.end();
     for (HashSet<uint32_t>::iterator it = m_tilesToRemove.begin(); it != tilesToRemoveEnd; ++it)
         m_tiles.remove(*it);
index 9310e37ddf217e19f9ef497d16c960638318ca41..819895f492ae5acede7d39aee1c4d87bc26ccfb9 100644 (file)
@@ -77,6 +77,8 @@ private:
     typedef HashMap<uint32_t, CoordinatedBackingStoreTile> CoordinatedBackingStoreTileMap;
     CoordinatedBackingStoreTileMap m_tiles;
     HashSet<uint32_t> m_tilesToRemove;
+    // FIXME: m_pendingSize should be removed after the following bug is fixed: https://bugs.webkit.org/show_bug.cgi?id=108294
+    FloatSize m_pendingSize;
     FloatSize m_size;
     float m_scale;
 };
index 103ed1defeca40fdcac615f2975077e759c0ddb2..2fc633513631368182e3af3027f2360b5a6247e6 100644 (file)
@@ -393,6 +393,7 @@ void CoordinatedGraphicsScene::prepareContentBackingStore(GraphicsLayer* graphic
     }
 
     createBackingStoreIfNeeded(graphicsLayer);
+    resetBackingStoreSizeToLayerSize(graphicsLayer);
 }
 
 void CoordinatedGraphicsScene::createBackingStoreIfNeeded(GraphicsLayer* graphicsLayer)
@@ -401,7 +402,6 @@ void CoordinatedGraphicsScene::createBackingStoreIfNeeded(GraphicsLayer* graphic
         return;
 
     RefPtr<CoordinatedBackingStore> backingStore(CoordinatedBackingStore::create());
-    backingStore->setSize(graphicsLayer->size());
     m_backingStores.add(graphicsLayer, backingStore);
     toGraphicsLayerTextureMapper(graphicsLayer)->setBackingStore(backingStore);
 }
@@ -420,6 +420,7 @@ void CoordinatedGraphicsScene::resetBackingStoreSizeToLayerSize(GraphicsLayer* g
     RefPtr<CoordinatedBackingStore> backingStore = m_backingStores.get(graphicsLayer);
     ASSERT(backingStore);
     backingStore->setSize(graphicsLayer->size());
+    m_backingStoresWithPendingBuffers.add(backingStore);
 }
 
 void CoordinatedGraphicsScene::createTile(CoordinatedLayerID layerID, uint32_t tileID, float scale)
@@ -428,7 +429,6 @@ void CoordinatedGraphicsScene::createTile(CoordinatedLayerID layerID, uint32_t t
     RefPtr<CoordinatedBackingStore> backingStore = m_backingStores.get(layer);
     ASSERT(backingStore);
     backingStore->createTile(tileID, scale);
-    resetBackingStoreSizeToLayerSize(layer);
 }
 
 void CoordinatedGraphicsScene::removeTile(CoordinatedLayerID layerID, uint32_t tileID)
@@ -439,7 +439,6 @@ void CoordinatedGraphicsScene::removeTile(CoordinatedLayerID layerID, uint32_t t
         return;
 
     backingStore->removeTile(tileID);
-    resetBackingStoreSizeToLayerSize(layer);
     m_backingStoresWithPendingBuffers.add(backingStore);
 }
 
@@ -453,7 +452,6 @@ void CoordinatedGraphicsScene::updateTile(CoordinatedLayerID layerID, uint32_t t
     ASSERT(it != m_surfaces.end());
 
     backingStore->updateTile(tileID, update.sourceRect, update.tileRect, it->value, update.offset);
-    resetBackingStoreSizeToLayerSize(layer);
     m_backingStoresWithPendingBuffers.add(backingStore);
 }