[Qt][WK2] Draw tiles of previous contents-scale for opaque layers if they don't inter...
authornoam.rosenthal@nokia.com <noam.rosenthal@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2012 23:33:49 +0000 (23:33 +0000)
committernoam.rosenthal@nokia.com <noam.rosenthal@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2012 23:33:49 +0000 (23:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=78962

Only avoid painting old-scale tiles in semi-transparent situtations if the old
tiles intersect with existing tiles.

Reviewed by Kenneth Rohde Christiansen.

* UIProcess/qt/LayerBackingStore.cpp:
(WebKit::LayerBackingStore::paintToTextureMapper):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/qt/LayerBackingStore.cpp

index 58d5c80..c158a06 100644 (file)
@@ -1,5 +1,18 @@
 2012-02-21  No'am Rosenthal  <noam.rosenthal@nokia.com>
 
+        [Qt][WK2] Draw tiles of previous contents-scale for opaque layers if they don't intersect with previous tiles
+        https://bugs.webkit.org/show_bug.cgi?id=78962
+
+        Only avoid painting old-scale tiles in semi-transparent situtations if the old
+        tiles intersect with existing tiles.
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * UIProcess/qt/LayerBackingStore.cpp:
+        (WebKit::LayerBackingStore::paintToTextureMapper):
+
+2012-02-21  No'am Rosenthal  <noam.rosenthal@nokia.com>
+
         [Qt] Previous web page appears outside content rect
         https://bugs.webkit.org/show_bug.cgi?id=78816
 
index 1c3c288..c6df57e 100644 (file)
@@ -100,6 +100,7 @@ void LayerBackingStore::paintToTextureMapper(TextureMapper* textureMapper, const
 
     // We have to do this every time we paint, in case the opacity has changed.
     HashMap<int, LayerBackingStoreTile>::iterator end = m_tiles.end();
+    FloatRect coveredRect;
     for (HashMap<int, LayerBackingStoreTile>::iterator it = m_tiles.begin(); it != end; ++it) {
         LayerBackingStoreTile& tile = it->second;
         if (!tile.texture())
@@ -107,12 +108,17 @@ void LayerBackingStore::paintToTextureMapper(TextureMapper* textureMapper, const
 
         if (tile.scale() == m_scale) {
             tilesToPaint.append(&tile);
+            coveredRect.unite(tile.rect());
             continue;
         }
 
         // Only show the previous tile if the opacity is high, otherwise effect looks like a bug.
-        if (opacity > 0.95)
-            tilesToPaint.prepend(&tile);
+        // We show the previous-scale tile anyway if it doesn't intersect with any current-scale tile.
+        if (opacity < 0.95 && coveredRect.intersects(tile.rect()))
+            continue;
+
+        tilesToPaint.prepend(&tile);
+        coveredRect.unite(tile.rect());
     }
 
     bool shouldClip = !targetRect.contains(coveredRect);