Changeset 106870 in webkit
- Timestamp:
- Feb 6, 2012, 4:25:16 PM (15 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/platform/graphics/chromium/TiledLayerChromium.cpp (modified) (1 diff)
-
WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp (modified) (1 diff)
-
WebKit/chromium/ChangeLog (modified) (1 diff)
-
WebKit/chromium/tests/TiledLayerChromiumTest.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r106864 r106870 1 2012-02-06 James Robinson <jamesr@chromium.org> 2 3 [chromium] Drop tiles completely outside of layer bounds when resizing to a smaller size 4 https://bugs.webkit.org/show_bug.cgi?id=77910 5 6 Reviewed by Kenneth Russell. 7 8 When resizing a tiled layer to a smaller size, drop all tiles that lie completely outside the new layer bounds. 9 This avoids attempting to access out-of-bounds tiles when iterating over all tiles in the tiler, which triggers 10 ASSERT()s, as well as saves some memory. 11 12 New unit test added to TiledLayerChromiumTest. 13 14 * platform/graphics/chromium/TiledLayerChromium.cpp: 15 (WebCore::TiledLayerChromium::invalidateRect): 16 * platform/graphics/chromium/cc/CCLayerTilingData.cpp: 17 (WebCore::CCLayerTilingData::setBounds): 18 1 19 2012-02-06 Chris Rogers <crogers@google.com> 2 20 -
trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
r106732 r106870 313 313 void TiledLayerChromium::invalidateRect(const IntRect& layerRect) 314 314 { 315 updateBounds(); 315 316 if (m_tiler->isEmpty() || layerRect.isEmpty() || m_skipsDraw) 316 317 return; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp
r106160 r106870 118 118 { 119 119 m_tilingData.setTotalSize(size.width(), size.height()); 120 121 // Any tiles completely outside our new bounds are invalid and should be dropped. 122 int left, top, right, bottom; 123 layerRectToTileIndices(IntRect(IntPoint(), size), left, top, right, bottom); 124 Vector<TileMapKey> invalidTileKeys; 125 for (TileMap::const_iterator it = m_tiles.begin(); it != m_tiles.end(); ++it) { 126 if (it->first.first > right || it->first.second > bottom) 127 invalidTileKeys.append(it->first); 128 } 129 for (size_t i = 0; i < invalidTileKeys.size(); ++i) 130 m_tiles.remove(invalidTileKeys[i]); 120 131 } 121 132 -
trunk/Source/WebKit/chromium/ChangeLog
r106867 r106870 1 2012-02-06 James Robinson <jamesr@chromium.org> 2 3 [chromium] Drop tiles completely outside of layer bounds when resizing to a smaller size 4 https://bugs.webkit.org/show_bug.cgi?id=77910 5 6 Reviewed by Kenneth Russell. 7 8 Adds test for resizing a layer to cover fewer tiles. Test hits ASSERT()s without any code changes. 9 10 * tests/TiledLayerChromiumTest.cpp: 11 (::TEST): 12 1 13 2012-02-06 Ryosuke Niwa <rniwa@webkit.org> 2 14 -
trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
r106700 r106870 566 566 } 567 567 568 TEST(TiledLayerChromiumTest, resizeToSmaller) 569 { 570 OwnPtr<TextureManager> textureManager = TextureManager::create(60*1024*1024, 60*1024*1024, 1024); 571 RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get())); 572 573 layer->setBounds(IntSize(700, 700)); 574 layer->invalidateRect(IntRect(0, 0, 700, 700)); 575 layer->prepareToUpdate(IntRect(0, 0, 700, 700)); 576 577 layer->setBounds(IntSize(200, 200)); 578 layer->invalidateRect(IntRect(0, 0, 200, 200)); 579 } 580 568 581 } // namespace
Note:
See TracChangeset
for help on using the changeset viewer.