Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5714)

Unified Diff: cc/tiles/tile_manager_unittest.cc

Issue 2110083004: Partial raster for GPU (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@partialuma2
Patch Set: Add missing resource cleanup to unit tests. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/tiles/tile_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/tile_manager_unittest.cc
diff --git a/cc/tiles/tile_manager_unittest.cc b/cc/tiles/tile_manager_unittest.cc
index ab6fafb43692dffae655b6f052db0ab1bbd8cd49..10d35efc0efd986877b5699111861fe34da22e84 100644
--- a/cc/tiles/tile_manager_unittest.cc
+++ b/cc/tiles/tile_manager_unittest.cc
@@ -1331,7 +1331,7 @@ TEST_F(TileManagerTilePriorityQueueTest,
host_impl()->tile_manager()->CheckIfMoreTilesNeedToBePreparedForTesting();
EXPECT_FALSE(host_impl()->is_likely_to_require_a_draw());
- host_impl()->resource_pool()->ReleaseResource(resource, 0);
+ host_impl()->resource_pool()->ReleaseResource(resource);
}
TEST_F(TileManagerTilePriorityQueueTest, DefaultMemoryPolicy) {
@@ -1783,8 +1783,11 @@ TEST_F(PartialRasterTileManagerTest, CancelledTasksHaveNoContentId) {
// Make sure that the tile we invalidated above was not returned to the pool
// with its invalidated resource ID.
host_impl()->resource_pool()->CheckBusyResources();
- EXPECT_FALSE(host_impl()->resource_pool()->TryAcquireResourceWithContentId(
- kInvalidatedId));
+ gfx::Rect total_invalidated_rect;
+ EXPECT_FALSE(host_impl()->resource_pool()->TryAcquireResourceForPartialRaster(
+ kInvalidatedId + 1, gfx::Rect(), kInvalidatedId,
+ &total_invalidated_rect));
+ EXPECT_EQ(gfx::Rect(), total_invalidated_rect);
// Free our host_impl_ before the tile_task_manager we passed it, as it
// will use that class in clean up.
@@ -1836,9 +1839,10 @@ void RunPartialRasterCheck(std::unique_ptr<LayerTreeHostImpl> host_impl,
&raster_buffer_provider);
// Ensure there's a resource with our |kInvalidatedId| in the resource pool.
- host_impl->resource_pool()->ReleaseResource(
- host_impl->resource_pool()->AcquireResource(kTileSize, RGBA_8888),
- kInvalidatedId);
+ auto* resource =
+ host_impl->resource_pool()->AcquireResource(kTileSize, RGBA_8888);
+ host_impl->resource_pool()->OnContentReplaced(resource->id(), kInvalidatedId);
+ host_impl->resource_pool()->ReleaseResource(resource);
host_impl->resource_pool()->CheckBusyResources();
scoped_refptr<FakeRasterSource> pending_raster_source =
« no previous file with comments | « cc/tiles/tile_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698