Title: [108397] trunk/Source/WebCore
Revision
108397
Author
[email protected]
Date
2012-02-21 14:21:51 -0800 (Tue, 21 Feb 2012)

Log Message

The tile cache should keep track of the tile coverage rect
https://bugs.webkit.org/show_bug.cgi?id=79149
<rdar://problem/10877338>

Reviewed by Andreas Kling.

Keep track of the tile coverage rect and use it to avoid trying to iterate over non-existent tiles on large pages.

* platform/graphics/ca/mac/TileCache.h:
(TileCache):
* platform/graphics/ca/mac/TileCache.mm:
(WebCore::TileCache::setNeedsDisplayInRect):
(WebCore::TileCache::revalidateTiles):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (108396 => 108397)


--- trunk/Source/WebCore/ChangeLog	2012-02-21 22:05:28 UTC (rev 108396)
+++ trunk/Source/WebCore/ChangeLog	2012-02-21 22:21:51 UTC (rev 108397)
@@ -1,3 +1,19 @@
+2012-02-21  Anders Carlsson  <[email protected]>
+
+        The tile cache should keep track of the tile coverage rect
+        https://bugs.webkit.org/show_bug.cgi?id=79149
+        <rdar://problem/10877338>
+
+        Reviewed by Andreas Kling.
+
+        Keep track of the tile coverage rect and use it to avoid trying to iterate over non-existent tiles on large pages.
+
+        * platform/graphics/ca/mac/TileCache.h:
+        (TileCache):
+        * platform/graphics/ca/mac/TileCache.mm:
+        (WebCore::TileCache::setNeedsDisplayInRect):
+        (WebCore::TileCache::revalidateTiles):
+
 2012-02-21  Andreas Kling  <[email protected]>
 
         Make WebKitCSSShaderValue inherit directly from CSSValue.

Modified: trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h (108396 => 108397)


--- trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h	2012-02-21 22:05:28 UTC (rev 108396)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h	2012-02-21 22:21:51 UTC (rev 108397)
@@ -27,7 +27,7 @@
 #define TileCache_h
 
 #include "IntPointHash.h"
-#include "IntSize.h"
+#include "IntRect.h"
 #include "Timer.h"
 #include <wtf/HashMap.h>
 #include <wtf/Noncopyable.h>
@@ -97,6 +97,7 @@
     typedef HashMap<TileIndex, RetainPtr<WebTileLayer> > TileMap;
     TileMap m_tiles;
     Timer<TileCache> m_tileRevalidationTimer;
+    IntRect m_tileCoverageRect;
 
     bool m_acceleratesDrawing;
 

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


--- trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm	2012-02-21 22:05:28 UTC (rev 108396)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm	2012-02-21 22:21:51 UTC (rev 108397)
@@ -93,7 +93,7 @@
     // Find the tiles that need to be invalidated.
     TileIndex topLeft;
     TileIndex bottomRight;
-    getTileIndexRangeForRect(rect, topLeft, bottomRight);
+    getTileIndexRangeForRect(intersection(rect, m_tileCoverageRect), topLeft, bottomRight);
 
     for (int y = topLeft.y(); y <= bottomRight.y(); ++y) {
         for (int x = topLeft.x(); x <= bottomRight.x(); ++x) {
@@ -333,6 +333,13 @@
         }
     }
 
+    m_tileCoverageRect = IntRect();
+    for (TileMap::iterator it = m_tiles.begin(), end = m_tiles.end(); it != end; ++it) {
+        const TileIndex& tileIndex = it->first;
+
+        m_tileCoverageRect.unite(rectForTileIndex(tileIndex));
+    }
+
     if (!didCreateNewTiles)
         return;
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to