Title: [111565] trunk/Source/WebKit2
Revision
111565
Author
[email protected]
Date
2012-03-21 10:22:04 -0700 (Wed, 21 Mar 2012)

Log Message

[Qt] Apply tile removals at the same time as update buffer swaps.
https://bugs.webkit.org/show_bug.cgi?id=81768

Reviewed by Kenneth Rohde Christiansen.

When committing the scale, we have to remove old tiles once the
tiles for the new scale are rendered. This should however wait
until those tiles gets their buffer swapped (following the DidRenderFrame
message) to make sure that there is no rendered gap between the removals
and updates swap.
This patch continues rendering the removed tiles until the DidRenderFrame
message is received to discard the old contents and show the new contents
at the same frame.

* UIProcess/WebLayerTreeRenderer.cpp:
(WebKit::WebLayerTreeRenderer::commitTileUpdates):
(WebKit::WebLayerTreeRenderer::flushLayerChanges):
* UIProcess/WebLayerTreeRenderer.h:
(WebLayerTreeRenderer):
* UIProcess/qt/LayerBackingStore.cpp:
(WebKit::LayerBackingStore::removeTile):
(WebKit::LayerBackingStore::commitTileUpdates):
* UIProcess/qt/LayerBackingStore.h:
(LayerBackingStore):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (111564 => 111565)


--- trunk/Source/WebKit2/ChangeLog	2012-03-21 17:20:47 UTC (rev 111564)
+++ trunk/Source/WebKit2/ChangeLog	2012-03-21 17:22:04 UTC (rev 111565)
@@ -1,5 +1,32 @@
 2012-03-21  Jocelyn Turcotte  <[email protected]>
 
+        [Qt] Apply tile removals at the same time as update buffer swaps.
+        https://bugs.webkit.org/show_bug.cgi?id=81768
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        When committing the scale, we have to remove old tiles once the
+        tiles for the new scale are rendered. This should however wait
+        until those tiles gets their buffer swapped (following the DidRenderFrame
+        message) to make sure that there is no rendered gap between the removals
+        and updates swap.
+        This patch continues rendering the removed tiles until the DidRenderFrame
+        message is received to discard the old contents and show the new contents
+        at the same frame.
+
+        * UIProcess/WebLayerTreeRenderer.cpp:
+        (WebKit::WebLayerTreeRenderer::commitTileUpdates):
+        (WebKit::WebLayerTreeRenderer::flushLayerChanges):
+        * UIProcess/WebLayerTreeRenderer.h:
+        (WebLayerTreeRenderer):
+        * UIProcess/qt/LayerBackingStore.cpp:
+        (WebKit::LayerBackingStore::removeTile):
+        (WebKit::LayerBackingStore::commitTileUpdates):
+        * UIProcess/qt/LayerBackingStore.h:
+        (LayerBackingStore):
+
+2012-03-21  Jocelyn Turcotte  <[email protected]>
+
         [Qt] Trigger scene graph repaints only for relevant layer updates.
         https://bugs.webkit.org/show_bug.cgi?id=81765
 

Modified: trunk/Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp (111564 => 111565)


--- trunk/Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp	2012-03-21 17:20:47 UTC (rev 111564)
+++ trunk/Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp	2012-03-21 17:22:04 UTC (rev 111565)
@@ -323,11 +323,11 @@
     layer->setContentsToMedia(it->second.get());
 }
 
-void WebLayerTreeRenderer::swapBuffers()
+void WebLayerTreeRenderer::commitTileOperations()
 {
     HashSet<RefPtr<LayerBackingStore> >::iterator end = m_backingStoresWithPendingBuffers.end();
     for (HashSet<RefPtr<LayerBackingStore> >::iterator it = m_backingStoresWithPendingBuffers.begin(); it != end; ++it)
-        (*it)->swapBuffers(m_textureMapper.get());
+        (*it)->commitTileOperations(m_textureMapper.get());
 
     m_backingStoresWithPendingBuffers.clear();
 }
@@ -335,7 +335,7 @@
 void WebLayerTreeRenderer::flushLayerChanges()
 {
     m_rootLayer->syncCompositingState(FloatRect());
-    swapBuffers();
+    commitTileOperations();
 
     // The pending tiles state is on its way for the screen, tell the web process to render the next one.
     callOnMainThread(bind(&WebLayerTreeRenderer::renderNextFrame, this));

Modified: trunk/Source/WebKit2/UIProcess/WebLayerTreeRenderer.h (111564 => 111565)


--- trunk/Source/WebKit2/UIProcess/WebLayerTreeRenderer.h	2012-03-21 17:20:47 UTC (rev 111564)
+++ trunk/Source/WebKit2/UIProcess/WebLayerTreeRenderer.h	2012-03-21 17:22:04 UTC (rev 111565)
@@ -100,7 +100,7 @@
     void assignImageToLayer(WebCore::GraphicsLayer*, int64_t imageID);
     void ensureRootLayer();
     void ensureLayer(WebLayerID);
-    void swapBuffers();
+    void commitTileOperations();
     void syncAnimations();
     void renderNextFrame();
     void purgeBackingStores();

Modified: trunk/Source/WebKit2/UIProcess/qt/LayerBackingStore.cpp (111564 => 111565)


--- trunk/Source/WebKit2/UIProcess/qt/LayerBackingStore.cpp	2012-03-21 17:20:47 UTC (rev 111564)
+++ trunk/Source/WebKit2/UIProcess/qt/LayerBackingStore.cpp	2012-03-21 17:22:04 UTC (rev 111565)
@@ -73,7 +73,7 @@
 
 void LayerBackingStore::removeTile(int id)
 {
-    m_tiles.remove(id);
+    m_tilesToRemove.append(id);
 }
 
 void LayerBackingStore::updateTile(int id, const IntRect& sourceRect, const IntRect& targetRect, ShareableBitmap* backBuffer)
@@ -134,10 +134,15 @@
         textureMapper->endClip();
 }
 
-void LayerBackingStore::swapBuffers(TextureMapper* textureMapper)
+void LayerBackingStore::commitTileOperations(TextureMapper* textureMapper)
 {
-    HashMap<int, LayerBackingStoreTile>::iterator end = m_tiles.end();
-    for (HashMap<int, LayerBackingStoreTile>::iterator it = m_tiles.begin(); it != end; ++it)
+    Vector<int>::iterator tilesToRemoveEnd = m_tilesToRemove.end();
+    for (Vector<int>::iterator it = m_tilesToRemove.begin(); it != tilesToRemoveEnd; ++it)
+        m_tiles.remove(*it);
+    m_tilesToRemove.clear();
+
+    HashMap<int, LayerBackingStoreTile>::iterator tilesEnd = m_tiles.end();
+    for (HashMap<int, LayerBackingStoreTile>::iterator it = m_tiles.begin(); it != tilesEnd; ++it)
         it->second.swapBuffers(textureMapper);
 }
 

Modified: trunk/Source/WebKit2/UIProcess/qt/LayerBackingStore.h (111564 => 111565)


--- trunk/Source/WebKit2/UIProcess/qt/LayerBackingStore.h	2012-03-21 17:20:47 UTC (rev 111564)
+++ trunk/Source/WebKit2/UIProcess/qt/LayerBackingStore.h	2012-03-21 17:22:04 UTC (rev 111565)
@@ -53,7 +53,7 @@
     void removeTile(int);
     void updateTile(int, const WebCore::IntRect&, const WebCore::IntRect&, ShareableBitmap*);
     static PassRefPtr<LayerBackingStore> create() { return adoptRef(new LayerBackingStore); }
-    void swapBuffers(WebCore::TextureMapper*);
+    void commitTileOperations(WebCore::TextureMapper*);
     PassRefPtr<WebCore::BitmapTexture> texture() const;
     virtual void paintToTextureMapper(WebCore::TextureMapper*, const WebCore::FloatRect&, const WebCore::TransformationMatrix&, float, WebCore::BitmapTexture*);
 
@@ -62,6 +62,7 @@
         : m_scale(1.)
     { }
     HashMap<int, LayerBackingStoreTile> m_tiles;
+    Vector<int> m_tilesToRemove;
     float m_scale;
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to