Chromium Code Reviews| Index: cc/resources/tile_manager.cc |
| diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc |
| index d8fb17d5b5c3d1e93c893b1903b6f89aba9066ae..4cdee0ffb1095ca5af77774941f924b7d1c15079 100644 |
| --- a/cc/resources/tile_manager.cc |
| +++ b/cc/resources/tile_manager.cc |
| @@ -372,14 +372,12 @@ scoped_ptr<TileManager> TileManager::Create( |
| ResourcePool* resource_pool, |
| Rasterizer* rasterizer, |
| Rasterizer* gpu_rasterizer, |
| - size_t max_raster_usage_bytes, |
| bool use_rasterize_on_demand, |
| RenderingStatsInstrumentation* rendering_stats_instrumentation) { |
| return make_scoped_ptr(new TileManager(client, |
| resource_pool, |
| rasterizer, |
| gpu_rasterizer, |
| - max_raster_usage_bytes, |
| use_rasterize_on_demand, |
| rendering_stats_instrumentation)); |
| } |
| @@ -389,7 +387,6 @@ TileManager::TileManager( |
| ResourcePool* resource_pool, |
| Rasterizer* rasterizer, |
| Rasterizer* gpu_rasterizer, |
| - size_t max_raster_usage_bytes, |
| bool use_rasterize_on_demand, |
| RenderingStatsInstrumentation* rendering_stats_instrumentation) |
| : client_(client), |
| @@ -401,7 +398,6 @@ TileManager::TileManager( |
| memory_nice_to_have_bytes_(0), |
| bytes_releasable_(0), |
| resources_releasable_(0), |
| - max_raster_usage_bytes_(max_raster_usage_bytes), |
| ever_exceeded_memory_budget_(false), |
| rendering_stats_instrumentation_(rendering_stats_instrumentation), |
| did_initialize_visible_tile_(false), |
| @@ -832,14 +828,6 @@ void TileManager::AssignGpuMemoryToTiles( |
| bool oomed_hard = false; |
| bool have_hit_soft_memory = false; // Soft memory comes after hard. |
| - // Memory we assign to raster tasks now will be deducted from our memory |
| - // in future iterations if priorities change. By assigning at most half |
| - // the raster limit, we will always have another 50% left even if priorities |
| - // change completely (assuming we check for completed/cancelled rasters |
| - // between each call to this function). |
|
reveman
2014/05/08 13:55:37
FYI, I'm OK removing this as I don't think this "a
vmpstr
2014/05/08 16:49:04
I agree with this as well. I think tile manager th
|
| - size_t max_raster_bytes = max_raster_usage_bytes_ / 2; |
| - size_t raster_bytes = 0; |
| - |
| unsigned schedule_priority = 1u; |
| for (PrioritizedTileSet::Iterator it(tiles, true); it; ++it) { |
| Tile* tile = *it; |
| @@ -864,7 +852,6 @@ void TileManager::AssignGpuMemoryToTiles( |
| const bool tile_uses_hard_limit = mts.bin <= NOW_BIN; |
| const size_t bytes_if_allocated = BytesConsumedIfAllocated(tile); |
| - const size_t raster_bytes_if_rastered = raster_bytes + bytes_if_allocated; |
| const size_t tile_bytes_left = |
| (tile_uses_hard_limit) ? hard_bytes_left : soft_bytes_left; |
| @@ -888,7 +875,7 @@ void TileManager::AssignGpuMemoryToTiles( |
| // Allow lower priority tiles with initialized resources to keep |
| // their memory by only assigning memory to new raster tasks if |
| // they can be scheduled. |
| - if (raster_bytes_if_rastered <= max_raster_bytes) { |
| + if (tiles_that_need_to_be_rasterized->size() < kScheduledRasterTasksLimit) { |
|
reveman
2014/05/08 13:55:37
why do we need a conditional here now? was this co
vmpstr
2014/05/08 16:49:04
I think it should've been <= raster_bytes || size
reveman
2014/05/08 17:07:51
Ok, please add a variable here instead of doing "t
alokp
2014/05/08 18:04:47
Done.
|
| // If we don't have the required version, and it's not in flight |
| // then we'll have to pay to create a new task. |
| if (!tile_version.resource_ && !tile_version.raster_task_) { |
| @@ -932,7 +919,7 @@ void TileManager::AssignGpuMemoryToTiles( |
| // 2. Tiles with existing raster task could otherwise incorrectly |
| // be added as they are not affected by |bytes_allocatable|. |
| bool can_schedule_tile = |
| - !oomed_soft && raster_bytes_if_rastered <= max_raster_bytes && |
| + !oomed_soft && |
| tiles_that_need_to_be_rasterized->size() < kScheduledRasterTasksLimit; |
| if (!can_schedule_tile) { |
| @@ -943,7 +930,6 @@ void TileManager::AssignGpuMemoryToTiles( |
| continue; |
| } |
| - raster_bytes = raster_bytes_if_rastered; |
| tiles_that_need_to_be_rasterized->push_back(tile); |
| } |