Changeset 106411 in webkit
- Timestamp:
- Jan 31, 2012 3:58:04 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r106408 r106411 1 2012-01-31 Anders Carlsson <andersca@apple.com> 2 3 TileCache::setNeedsDisplayInRect cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=77486 5 6 Reviewed by Andreas Kling. 7 8 * platform/graphics/ca/mac/TileCache.h: 9 * platform/graphics/ca/mac/TileCache.mm: 10 (WebCore::TileCache::setNeedsDisplayInRect): 11 TileCache::tileLayerAtIndex can in the future return nil, so cope with that. Also, replace 12 nested if statements with continue statements. 13 14 (WebCore::TileCache::getTileIndexRangeForRect): 15 Rename this to better indicate that it returns a range of indices. 16 1 17 2012-01-31 Dana Jansens <danakj@chromium.org> 2 18 -
trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h
r106397 r106411 76 76 77 77 IntRect bounds() const; 78 void getTile RangeForRect(const IntRect&, IntPoint& topLeft, IntPoint& bottomRight);78 void getTileIndexRangeForRect(const IntRect&, TileIndex& topLeft, TileIndex& bottomRight); 79 79 80 80 IntSize numTilesForGridSize(const IntSize&) const; -
trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm
r106397 r106411 82 82 83 83 // Find the tiles that need to be invalidated. 84 IntPointtopLeft;85 IntPointbottomRight;86 getTile RangeForRect(rect, topLeft, bottomRight);84 TileIndex topLeft; 85 TileIndex bottomRight; 86 getTileIndexRangeForRect(rect, topLeft, bottomRight); 87 87 88 88 for (int y = topLeft.y(); y <= bottomRight.y(); ++y) { 89 89 for (int x = topLeft.x(); x <= bottomRight.x(); ++x) { 90 WebTileLayer* tileLayer = tileLayerAtIndex(IntPoint(x, y)); 90 WebTileLayer* tileLayer = tileLayerAtIndex(TileIndex(x, y)); 91 if (!tileLayer) 92 continue; 91 93 92 94 CGRect tileRect = [m_tileCacheLayer convertRect:rect toLayer:tileLayer]; 93 94 if (!CGRectIsEmpty(tileRect)) {95 [tileLayer setNeedsDisplayInRect:tileRect]; 96 97 if (shouldShowRepaintCounters()) { 98 CGRect bounds = [tileLayer bounds];99 CGRect indicatorRect = CGRectMake(bounds.origin.x, bounds.origin.y, 52, 27);100 [tileLayer setNeedsDisplayInRect:indicatorRect];101 }95 if (CGRectIsEmpty(tileRect)) 96 continue; 97 98 [tileLayer setNeedsDisplayInRect:tileRect]; 99 100 if (shouldShowRepaintCounters()) { 101 CGRect bounds = [tileLayer bounds]; 102 CGRect indicatorRect = CGRectMake(bounds.origin.x, bounds.origin.y, 52, 27); 103 [tileLayer setNeedsDisplayInRect:indicatorRect]; 102 104 } 103 105 } … … 218 220 } 219 221 220 void TileCache::getTile RangeForRect(const IntRect& rect, IntPoint& topLeft, IntPoint& bottomRight)222 void TileCache::getTileIndexRangeForRect(const IntRect& rect, TileIndex& topLeft, TileIndex& bottomRight) 221 223 { 222 224 topLeft.setX(max(rect.x() / m_tileSize.width(), 0)); … … 247 249 if (x < m_numTilesInGrid.width() && y < m_numTilesInGrid.height()) { 248 250 // We can reuse the tile layer at this index. 249 tileLayer = tileLayerAtIndex( IntPoint(x, y));251 tileLayer = tileLayerAtIndex(TileIndex(x, y)); 250 252 } else { 251 253 tileLayer = createTileLayer(); 252 m_tiles.set( IntPoint(x, y), tileLayer.get());254 m_tiles.set(TileIndex(x, y), tileLayer.get()); 253 255 } 254 256
Note: See TracChangeset
for help on using the changeset viewer.