Changeset 138997 in webkit
- Timestamp:
- Jan 7, 2013, 3:17:36 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r138994 r138997 1 2013-01-07 Tim Horton <timothy_horton@apple.com> 2 3 Tiled-layer TileCaches shouldn't unparent offscreen tiles 4 https://bugs.webkit.org/show_bug.cgi?id=106258 5 <rdar://problem/12969116> 6 7 Reviewed by Simon Fraser. 8 9 Add a setting on TiledBacking (implemented on TileCache) that controls whether or not 10 the TileCache should unparent offscreen tiles. We can't use this behavior for tiled-layer TileCaches 11 currently because m_isInWindow is not updated for tiled-layer TileCaches, and because we haven't 12 decided exactly what their behavior should be. So, revert to the old behavior for them. 13 14 * platform/graphics/TiledBacking.h: 15 * platform/graphics/ca/mac/TileCache.h: 16 (TileCache): Add setUnparentsOffscreenTiles/unparentsOffscreenTiles. 17 * platform/graphics/ca/mac/TileCache.mm: 18 (WebCore::TileCache::TileCache): m_unparentsOffscreenTiles defaults to false. 19 (WebCore::TileCache::revalidateTiles): 20 Return to the old behavior of always adding new layers to the layer tree regardless of m_isInWindow if m_unparentsOffscreenTiles is false. 21 Return to the old behavior of never unparenting tiles regardless of m_isInWindow if m_unparentsOffscreenTiles is false. 22 (WebCore::TileCache::ensureTilesForRect): Return to the old behavior of always ensuring tiles regardless of m_isInWindow if m_unparentsOffscreenTiles is false. 23 * rendering/RenderLayerBacking.cpp: 24 (WebCore::RenderLayerBacking::RenderLayerBacking): Tell primary TileCaches that it's OK to unparent offscreen tiles. 25 1 26 2013-01-07 Justin Novosad <junov@google.com> 2 27 -
trunk/Source/WebCore/platform/graphics/TiledBacking.h
r138858 r138997 73 73 virtual void setAggressivelyRetainsTiles(bool) = 0; 74 74 virtual bool aggressivelyRetainsTiles() const = 0; 75 76 virtual void setUnparentsOffscreenTiles(bool) = 0; 77 virtual bool unparentsOffscreenTiles() const = 0; 75 78 76 79 // Exposed for testing -
trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h
r138858 r138997 118 118 virtual void setAggressivelyRetainsTiles(bool flag) OVERRIDE { m_aggressivelyRetainsTiles = flag; } 119 119 virtual bool aggressivelyRetainsTiles() const OVERRIDE { return m_aggressivelyRetainsTiles; } 120 virtual void setUnparentsOffscreenTiles(bool flag) OVERRIDE { m_unparentsOffscreenTiles = flag; } 121 virtual bool unparentsOffscreenTiles() const OVERRIDE { return m_unparentsOffscreenTiles; } 120 122 virtual IntRect tileCoverageRect() const OVERRIDE; 121 123 virtual CALayer *tiledScrollingIndicatorLayer() OVERRIDE; … … 193 195 bool m_scrollingPerformanceLoggingEnabled; 194 196 bool m_aggressivelyRetainsTiles; 197 bool m_unparentsOffscreenTiles; 195 198 bool m_acceleratesDrawing; 196 199 bool m_tilesAreOpaque; -
trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm
r138858 r138997 107 107 , m_scrollingPerformanceLoggingEnabled(false) 108 108 , m_aggressivelyRetainsTiles(false) 109 , m_unparentsOffscreenTiles(false) 109 110 , m_acceleratesDrawing(false) 110 111 , m_tilesAreOpaque(false) … … 587 588 tileInfo.cohort = currCohort; 588 589 ++tilesInCohort; 589 [tileInfo.layer.get() removeFromSuperlayer]; 590 591 if (m_unparentsOffscreenTiles) 592 [tileInfo.layer.get() removeFromSuperlayer]; 590 593 } 591 594 } … … 618 621 if (!tileInfo.layer) { 619 622 tileInfo.layer = createTileLayer(tileRect); 620 if ( m_isInWindow)623 if (!m_unparentsOffscreenTiles || m_isInWindow) 621 624 [m_tileContainerLayer.get() addSublayer:tileInfo.layer.get()]; 622 625 } else { 623 if ( m_isInWindow&& ![tileInfo.layer.get() superlayer])626 if ((!m_unparentsOffscreenTiles || m_isInWindow) && ![tileInfo.layer.get() superlayer]) 624 627 [m_tileContainerLayer.get() addSublayer:tileInfo.layer.get()]; 625 628 … … 643 646 } 644 647 645 if ( validationPolicy & UnparentAllTiles) {648 if (m_unparentsOffscreenTiles && (validationPolicy & UnparentAllTiles)) { 646 649 for (TileMap::iterator it = m_tiles.begin(), end = m_tiles.end(); it != end; ++it) 647 650 [it->value.layer.get() removeFromSuperlayer]; … … 711 714 void TileCache::ensureTilesForRect(const IntRect& rect) 712 715 { 713 if ( !m_isInWindow)716 if (m_unparentsOffscreenTiles && !m_isInWindow) 714 717 return; 715 718 -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r138809 r138997 131 131 Frame* frame = renderer()->frame(); 132 132 tiledBacking->setIsInWindow(page->isOnscreen()); 133 134 if (m_isMainFrameRenderViewLayer) 135 tiledBacking->setUnparentsOffscreenTiles(true); 136 133 137 tiledBacking->setScrollingPerformanceLoggingEnabled(frame->settings() && frame->settings()->scrollingPerformanceLoggingEnabled()); 134 138 adjustTileCacheCoverage();
Note:
See TracChangeset
for help on using the changeset viewer.