Title: [116579] trunk/Source/WebCore
Revision
116579
Author
[email protected]
Date
2012-05-09 17:12:48 -0700 (Wed, 09 May 2012)

Log Message

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.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (116578 => 116579)


--- trunk/Source/WebCore/ChangeLog	2012-05-10 00:04:25 UTC (rev 116578)
+++ trunk/Source/WebCore/ChangeLog	2012-05-10 00:12:48 UTC (rev 116579)
@@ -1,3 +1,20 @@
+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-09  Alexandre Elias  <[email protected]>
 
         setPageScaleFactor should setScrollPosition if scale is unchanged

Modified: trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm (116578 => 116579)


--- trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm	2012-05-10 00:04:25 UTC (rev 116578)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm	2012-05-10 00:12:48 UTC (rev 116579)
@@ -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