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):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108397
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-21 Anders Carlsson <andersca@apple.com>
+
+ 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 <awesomekling@apple.com>
Make WebKitCSSShaderValue inherit directly from CSSValue.
#define TileCache_h
#include "IntPointHash.h"
-#include "IntSize.h"
+#include "IntRect.h"
#include "Timer.h"
#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
typedef HashMap<TileIndex, RetainPtr<WebTileLayer> > TileMap;
TileMap m_tiles;
Timer<TileCache> m_tileRevalidationTimer;
+ IntRect m_tileCoverageRect;
bool m_acceleratesDrawing;
// 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) {
}
}
+ 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;