Diff
Modified: tags/Safari-537.24.2/Source/WebCore/ChangeLog (138998 => 138999)
--- tags/Safari-537.24.2/Source/WebCore/ChangeLog 2013-01-07 23:18:27 UTC (rev 138998)
+++ tags/Safari-537.24.2/Source/WebCore/ChangeLog 2013-01-07 23:23:13 UTC (rev 138999)
@@ -1,5 +1,34 @@
-2012-01-07 Lucas Forschler <[email protected]>
+2013-01-07 Lucas Forschler <[email protected]>
+ Merge r138997
+
+ 2013-01-07 Tim Horton <[email protected]>
+
+ Tiled-layer TileCaches shouldn't unparent offscreen tiles
+ https://bugs.webkit.org/show_bug.cgi?id=106258
+ <rdar://problem/12969116>
+
+ Reviewed by Simon Fraser.
+
+ Add a setting on TiledBacking (implemented on TileCache) that controls whether or not
+ the TileCache should unparent offscreen tiles. We can't use this behavior for tiled-layer TileCaches
+ currently because m_isInWindow is not updated for tiled-layer TileCaches, and because we haven't
+ decided exactly what their behavior should be. So, revert to the old behavior for them.
+
+ * platform/graphics/TiledBacking.h:
+ * platform/graphics/ca/mac/TileCache.h:
+ (TileCache): Add setUnparentsOffscreenTiles/unparentsOffscreenTiles.
+ * platform/graphics/ca/mac/TileCache.mm:
+ (WebCore::TileCache::TileCache): m_unparentsOffscreenTiles defaults to false.
+ (WebCore::TileCache::revalidateTiles):
+ Return to the old behavior of always adding new layers to the layer tree regardless of m_isInWindow if m_unparentsOffscreenTiles is false.
+ Return to the old behavior of never unparenting tiles regardless of m_isInWindow if m_unparentsOffscreenTiles is false.
+ (WebCore::TileCache::ensureTilesForRect): Return to the old behavior of always ensuring tiles regardless of m_isInWindow if m_unparentsOffscreenTiles is false.
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::RenderLayerBacking): Tell primary TileCaches that it's OK to unparent offscreen tiles.
+
+2013-01-07 Lucas Forschler <[email protected]>
+
Merge r138858
2013-01-04 Tim Horton <[email protected]>
@@ -51,7 +80,7 @@
(WebCore::TileCache::drawTileMapContents):
Draw a thick purple border around tiles that have been unparented.
-2012-01-04 Lucas Forschler <[email protected]>
+2013-01-04 Lucas Forschler <[email protected]>
Merge r138877
Modified: tags/Safari-537.24.2/Source/WebCore/platform/graphics/TiledBacking.h (138998 => 138999)
--- tags/Safari-537.24.2/Source/WebCore/platform/graphics/TiledBacking.h 2013-01-07 23:18:27 UTC (rev 138998)
+++ tags/Safari-537.24.2/Source/WebCore/platform/graphics/TiledBacking.h 2013-01-07 23:23:13 UTC (rev 138999)
@@ -72,6 +72,9 @@
virtual void setAggressivelyRetainsTiles(bool) = 0;
virtual bool aggressivelyRetainsTiles() const = 0;
+
+ virtual void setUnparentsOffscreenTiles(bool) = 0;
+ virtual bool unparentsOffscreenTiles() const = 0;
// Exposed for testing
virtual IntRect tileCoverageRect() const = 0;
Modified: tags/Safari-537.24.2/Source/WebCore/platform/graphics/ca/mac/TileCache.h (138998 => 138999)
--- tags/Safari-537.24.2/Source/WebCore/platform/graphics/ca/mac/TileCache.h 2013-01-07 23:18:27 UTC (rev 138998)
+++ tags/Safari-537.24.2/Source/WebCore/platform/graphics/ca/mac/TileCache.h 2013-01-07 23:23:13 UTC (rev 138999)
@@ -117,6 +117,8 @@
virtual bool scrollingPerformanceLoggingEnabled() const OVERRIDE { return m_scrollingPerformanceLoggingEnabled; }
virtual void setAggressivelyRetainsTiles(bool flag) OVERRIDE { m_aggressivelyRetainsTiles = flag; }
virtual bool aggressivelyRetainsTiles() const OVERRIDE { return m_aggressivelyRetainsTiles; }
+ virtual void setUnparentsOffscreenTiles(bool flag) OVERRIDE { m_unparentsOffscreenTiles = flag; }
+ virtual bool unparentsOffscreenTiles() const OVERRIDE { return m_unparentsOffscreenTiles; }
virtual IntRect tileCoverageRect() const OVERRIDE;
virtual CALayer *tiledScrollingIndicatorLayer() OVERRIDE;
virtual void setScrollingModeIndication(ScrollingModeIndication) OVERRIDE;
@@ -192,6 +194,7 @@
bool m_isInWindow;
bool m_scrollingPerformanceLoggingEnabled;
bool m_aggressivelyRetainsTiles;
+ bool m_unparentsOffscreenTiles;
bool m_acceleratesDrawing;
bool m_tilesAreOpaque;
Modified: tags/Safari-537.24.2/Source/WebCore/platform/graphics/ca/mac/TileCache.mm (138998 => 138999)
--- tags/Safari-537.24.2/Source/WebCore/platform/graphics/ca/mac/TileCache.mm 2013-01-07 23:18:27 UTC (rev 138998)
+++ tags/Safari-537.24.2/Source/WebCore/platform/graphics/ca/mac/TileCache.mm 2013-01-07 23:23:13 UTC (rev 138999)
@@ -106,6 +106,7 @@
, m_isInWindow(false)
, m_scrollingPerformanceLoggingEnabled(false)
, m_aggressivelyRetainsTiles(false)
+ , m_unparentsOffscreenTiles(false)
, m_acceleratesDrawing(false)
, m_tilesAreOpaque(false)
, m_tileDebugBorderWidth(0)
@@ -586,7 +587,9 @@
if (tileInfo.cohort == VisibleTileCohort) {
tileInfo.cohort = currCohort;
++tilesInCohort;
- [tileInfo.layer.get() removeFromSuperlayer];
+
+ if (m_unparentsOffscreenTiles)
+ [tileInfo.layer.get() removeFromSuperlayer];
}
}
}
@@ -617,10 +620,10 @@
TileInfo& tileInfo = m_tiles.add(tileIndex, TileInfo()).iterator->value;
if (!tileInfo.layer) {
tileInfo.layer = createTileLayer(tileRect);
- if (m_isInWindow)
+ if (!m_unparentsOffscreenTiles || m_isInWindow)
[m_tileContainerLayer.get() addSublayer:tileInfo.layer.get()];
} else {
- if (m_isInWindow && ![tileInfo.layer.get() superlayer])
+ if ((!m_unparentsOffscreenTiles || m_isInWindow) && ![tileInfo.layer.get() superlayer])
[m_tileContainerLayer.get() addSublayer:tileInfo.layer.get()];
// We already have a layer for this tile. Ensure that its size is correct.
@@ -642,7 +645,7 @@
m_cohortList.clear();
}
- if (validationPolicy & UnparentAllTiles) {
+ if (m_unparentsOffscreenTiles && (validationPolicy & UnparentAllTiles)) {
for (TileMap::iterator it = m_tiles.begin(), end = m_tiles.end(); it != end; ++it)
[it->value.layer.get() removeFromSuperlayer];
}
@@ -710,7 +713,7 @@
void TileCache::ensureTilesForRect(const IntRect& rect)
{
- if (!m_isInWindow)
+ if (m_unparentsOffscreenTiles && !m_isInWindow)
return;
PlatformCALayer* platformLayer = PlatformCALayer::platformCALayer(m_tileCacheLayer);
Modified: tags/Safari-537.24.2/Source/WebCore/rendering/RenderLayerBacking.cpp (138998 => 138999)
--- tags/Safari-537.24.2/Source/WebCore/rendering/RenderLayerBacking.cpp 2013-01-07 23:18:27 UTC (rev 138998)
+++ tags/Safari-537.24.2/Source/WebCore/rendering/RenderLayerBacking.cpp 2013-01-07 23:23:13 UTC (rev 138999)
@@ -130,6 +130,10 @@
if (Page* page = renderer()->frame()->page()) {
Frame* frame = renderer()->frame();
tiledBacking->setIsInWindow(page->isOnscreen());
+
+ if (m_isMainFrameRenderViewLayer)
+ tiledBacking->setUnparentsOffscreenTiles(true);
+
tiledBacking->setScrollingPerformanceLoggingEnabled(frame->settings() && frame->settings()->scrollingPerformanceLoggingEnabled());
adjustTileCacheCoverage();
}