Changeset 132427 in webkit
- Timestamp:
- Oct 24, 2012, 5:19:35 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r132424 r132427 1 2012-10-24 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=100169 4 We should make TileCache tiles the size of the tile coverage rect 5 when we can't do fast scrolling 6 -and- 7 <rdar://problem/12505021> 8 9 Reviewed by Simon Fraser. 10 11 New test. 12 * platform/mac/tiled-drawing/tile-coverage-slow-scrolling-expected.txt: Added. 13 * platform/mac/tiled-drawing/tile-coverage-slow-scrolling.html: Added. 14 1 15 2012-10-24 David Barton <dbarton@mathscribe.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r132424 r132427 1 2012-10-24 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=100169 4 We should make TileCache tiles the size of the tile coverage rect 5 when we can't do fast scrolling 6 -and- 7 <rdar://problem/12505021> 8 9 Reviewed by Simon Fraser. 10 11 Some websites that don't do fast scrolling still scroll slower than 12 they do with tiled drawing disabled. 13 https://bugs.webkit.org/show_bug.cgi?id=99768 addressed some of this 14 performance problem, but there is still more ground to make up. This 15 patch addresses the remaining issue by making tiles the size of the 16 window when we can't do fast scrolling. 17 18 The constructor and create function no longer take a size parameter. 19 That's all fully controlled within TileCache now. m_tileSize is no 20 longer const. 21 * platform/graphics/ca/mac/TileCache.h: 22 23 Store the current default size as constants so that we can access it 24 in both the constructor and adjustTileSizeForCoverageRect(). 25 * platform/graphics/ca/mac/TileCache.mm: 26 (WebCore::TileCache::TileCache): 27 28 This new function will set m_tileSize to the size of the tile 29 coverage rect if the tile coverage is limited to the visible area. 30 Otherwise, the tiles are set to be the default size. 31 (WebCore::TileCache::adjustTileSizeForCoverageRect): 32 33 Call adjustTileSizeForCoverageRect(). 34 (WebCore::TileCache::revalidateTiles): 35 36 No need to send in a size anymore. 37 * platform/graphics/ca/mac/WebTileCacheLayer.h: 38 (WebCore): 39 1 40 2012-10-24 David Barton <dbarton@mathscribe.com> 2 41 -
trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h
r132301 r132427 52 52 53 53 public: 54 static PassOwnPtr<TileCache> create(WebTileCacheLayer* , const IntSize& tileSize);54 static PassOwnPtr<TileCache> create(WebTileCacheLayer*); 55 55 ~TileCache(); 56 56 … … 80 80 81 81 private: 82 TileCache(WebTileCacheLayer* , const IntSize& tileSize);82 TileCache(WebTileCacheLayer*); 83 83 84 84 // TiledBacking member functions. … … 100 100 101 101 IntRect computeTileCoverageRect() const; 102 IntSize tileSizeForCoverageRect(const IntRect&) const; 102 103 103 104 void scheduleTileRevalidation(double interval); … … 113 114 WebTileCacheLayer* m_tileCacheLayer; 114 115 RetainPtr<CALayer> m_tileContainerLayer; 115 constIntSize m_tileSize;116 IntSize m_tileSize; 116 117 IntRect m_visibleRect; 117 118 -
trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm
r132301 r132427 46 46 namespace WebCore { 47 47 48 PassOwnPtr<TileCache> TileCache::create(WebTileCacheLayer* tileCacheLayer, const IntSize& tileSize) 49 { 50 return adoptPtr(new TileCache(tileCacheLayer, tileSize)); 51 } 52 53 TileCache::TileCache(WebTileCacheLayer* tileCacheLayer, const IntSize& tileSize) 48 static const int defaultTileCacheWidth = 512; 49 static const int defaultTileCacheHeight = 512; 50 51 PassOwnPtr<TileCache> TileCache::create(WebTileCacheLayer* tileCacheLayer) 52 { 53 return adoptPtr(new TileCache(tileCacheLayer)); 54 } 55 56 TileCache::TileCache(WebTileCacheLayer* tileCacheLayer) 54 57 : m_tileCacheLayer(tileCacheLayer) 55 58 , m_tileContainerLayer(adoptCF([[CALayer alloc] init])) 56 , m_tileSize( tileSize)59 , m_tileSize(defaultTileCacheWidth, defaultTileCacheHeight) 57 60 , m_tileRevalidationTimer(this, &TileCache::tileRevalidationTimerFired) 58 61 , m_scale(1) … … 301 304 topLeft.setX(max(clampedRect.x() / m_tileSize.width(), 0)); 302 305 topLeft.setY(max(clampedRect.y() / m_tileSize.height(), 0)); 303 bottomRight.setX(max(clampedRect.maxX() / m_tileSize.width(), 0)); 304 bottomRight.setY(max(clampedRect.maxY() / m_tileSize.height(), 0)); 306 307 int bottomXRatio = ceil((float)clampedRect.maxX() / m_tileSize.width()); 308 bottomRight.setX(max(bottomXRatio - 1, 0)); 309 310 int bottomYRatio = ceil((float)clampedRect.maxY() / m_tileSize.height()); 311 bottomRight.setY(max(bottomYRatio - 1, 0)); 305 312 } 306 313 … … 326 333 } 327 334 335 IntSize TileCache::tileSizeForCoverageRect(const IntRect& coverageRect) const 336 { 337 if (m_tileCoverage == CoverageForVisibleArea) 338 return coverageRect.size(); 339 return IntSize(defaultTileCacheWidth, defaultTileCacheHeight); 340 } 341 328 342 void TileCache::scheduleTileRevalidation(double interval) 329 343 { … … 380 394 IntRect tileCoverageRect = computeTileCoverageRect(); 381 395 396 IntSize oldTileSize = m_tileSize; 397 m_tileSize = tileSizeForCoverageRect(tileCoverageRect); 398 bool tileSizeChanged = m_tileSize != oldTileSize; 399 382 400 Vector<TileIndex> tilesToRemove; 383 401 … … 387 405 WebTileLayer* tileLayer = it->value.get(); 388 406 389 if (!rectForTileIndex(tileIndex).intersects(tileCoverageRect) ) {407 if (!rectForTileIndex(tileIndex).intersects(tileCoverageRect) || tileSizeChanged) { 390 408 // Remove this layer. 391 409 [tileLayer removeFromSuperlayer]; -
trunk/Source/WebCore/platform/graphics/ca/mac/WebTileCacheLayer.mm
r130554 r132427 41 41 return nil; 42 42 43 // FIXME: The tile size should be configurable. 44 _tileCache = TileCache::create(self, IntSize(512, 512)); 43 _tileCache = TileCache::create(self); 45 44 #ifndef NDEBUG 46 45 [self setName:@"WebTileCacheLayer"];
Note:
See TracChangeset
for help on using the changeset viewer.