Title: [117132] branches/safari-536-branch/Source/WebCore

Diff

Modified: branches/safari-536-branch/Source/WebCore/ChangeLog (117131 => 117132)


--- branches/safari-536-branch/Source/WebCore/ChangeLog	2012-05-15 20:05:44 UTC (rev 117131)
+++ branches/safari-536-branch/Source/WebCore/ChangeLog	2012-05-15 20:07:31 UTC (rev 117132)
@@ -1,5 +1,26 @@
 2012-05-15  Lucas Forschler  <[email protected]>
 
+    Merge 116579
+
+    2012-05-09  Anders Carlsson  <[email protected]>
+
+            Speed up some parts of TileCache drawing
+            https://bugs.webkit.org/show_bug.cgi?id=86033
+            <rdar://problem/10919373>
+
+            Reviewed by Sam Weinig.
+
+            * platform/graphics/ca/mac/TileCache.mm:
+            (WebCore::TileCache::tileCoverageRect):
+            If we can't have scrollbars, there's not much need to extend the tile coverage rect outside of the visible rect, since it's
+            unlikely that we'll do any form of scrolling here.
+
+            (WebCore::TileCache::revalidateTiles):
+            Don't update the tile layer frame if it's big enough to contain the tile size. Also, if there are no new tiles created,
+            don't call platformCALayerDidCreateTiles since that will trigger an extra layer flush.
+
+2012-05-15  Lucas Forschler  <[email protected]>
+
     Merge 116570
 
     2012-05-09  Beth Dakin  <[email protected]>

Modified: branches/safari-536-branch/Source/WebCore/platform/graphics/ca/mac/TileCache.mm (117131 => 117132)


--- branches/safari-536-branch/Source/WebCore/platform/graphics/ca/mac/TileCache.mm	2012-05-15 20:05:44 UTC (rev 117131)
+++ branches/safari-536-branch/Source/WebCore/platform/graphics/ca/mac/TileCache.mm	2012-05-15 20:07:31 UTC (rev 117132)
@@ -275,7 +275,10 @@
 {
     IntRect tileCoverageRect = m_visibleRect;
 
-    if (m_isInWindow) {
+    // If the page is not in a window (for example if it's in a background tab), we limit the tile coverage rect to the visible rect.
+    // Furthermore, if the page can't have scrollbars (for example if its body element has overflow:hidden) it's very unlikely that the
+    // page will ever be scrolled so we limit the tile coverage rect as well.
+    if (m_isInWindow && m_canHaveScrollbars) {
         // Inflate the coverage rect so that it covers 2x of the visible width and 3x of the visible height.
         // These values were chosen because it's more common to have tall pages and to scroll vertically,
         // so we keep more tiles above and below the current area.
@@ -351,7 +354,8 @@
                 [m_tileContainerLayer.get() addSublayer:tileLayer.get()];
             } else {
                 // We already have a layer for this tile. Ensure that its size is correct.
-                if (CGSizeEqualToSize([tileLayer.get() frame].size, tileRect.size()))
+                CGSize tileLayerSize = [tileLayer.get() frame].size;
+                if (tileLayerSize.width >= tileRect.width() && tileLayerSize.height >= tileRect.height())
                     continue;
                 [tileLayer.get() setFrame:tileRect];
             }
@@ -369,6 +373,8 @@
         m_tileCoverageRect.unite(rectForTileIndex(tileIndex));
     }
 
+    if (dirtyRects.isEmpty())
+        return;
     platformLayer->owner()->platformCALayerDidCreateTiles(dirtyRects);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to