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

Unified Diff: cc/resources/tile_manager.cc

Issue 860813002: Remove the default format from ResourcePool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile error in perftest. Created 5 years, 11 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
Index: cc/resources/tile_manager.cc
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc
index 3ca3b1c503b957be3a1bb39f6c1278e109b9948f..03848d23f7411afc1e07afcc02d20d2f5768044a 100644
--- a/cc/resources/tile_manager.cc
+++ b/cc/resources/tile_manager.cc
@@ -198,11 +198,13 @@ scoped_ptr<TileManager> TileManager::Create(
TileManagerClient* client,
base::SequencedTaskRunner* task_runner,
ResourcePool* resource_pool,
+ ResourceFormat resource_format,
TileTaskRunner* tile_task_runner,
Rasterizer* rasterizer,
size_t scheduled_raster_task_limit) {
return make_scoped_ptr(new TileManager(client, task_runner, resource_pool,
- tile_task_runner, rasterizer,
+ resource_format, tile_task_runner,
+ rasterizer,
scheduled_raster_task_limit));
}
@@ -210,6 +212,7 @@ TileManager::TileManager(
TileManagerClient* client,
const scoped_refptr<base::SequencedTaskRunner>& task_runner,
ResourcePool* resource_pool,
+ ResourceFormat resource_format,
TileTaskRunner* tile_task_runner,
Rasterizer* rasterizer,
size_t scheduled_raster_task_limit)
@@ -222,6 +225,7 @@ TileManager::TileManager(
all_tiles_that_need_to_be_rasterized_are_scheduled_(true),
did_check_for_completed_tasks_since_last_schedule_tasks_(true),
did_oom_on_last_assign_(false),
+ resource_format_(resource_format),
ready_to_activate_notifier_(
task_runner_.get(),
base::Bind(&TileManager::NotifyReadyToActivate,
@@ -412,7 +416,7 @@ void TileManager::SynchronouslyRasterizeTiles(
// Run and complete all raster task synchronously.
rasterizer_->RasterizeTiles(
- tiles_that_need_to_be_rasterized, resource_pool_,
+ tiles_that_need_to_be_rasterized, resource_pool_, resource_format_,
base::Bind(&TileManager::UpdateTileDrawInfo, base::Unretained(this)));
// Use on-demand raster for any required-for-draw tiles that have not been
@@ -622,7 +626,7 @@ void TileManager::AssignGpuMemoryToTiles(
MemoryUsage memory_required_by_tile_to_be_scheduled;
if (!tile->raster_task_.get()) {
memory_required_by_tile_to_be_scheduled = MemoryUsage::FromConfig(
- tile->desired_texture_size(), resource_pool_->default_format());
+ tile->desired_texture_size(), resource_format_);
}
bool tile_is_needed_now = priority.priority_bin == TilePriority::NOW;
@@ -756,7 +760,7 @@ scoped_refptr<ImageDecodeTask> TileManager::CreateImageDecodeTask(
scoped_refptr<RasterTask> TileManager::CreateRasterTask(Tile* tile) {
scoped_ptr<ScopedResource> resource =
resource_pool_->AcquireResource(tile->desired_texture_size(),
- resource_pool_->default_format());
+ resource_format_);
const ScopedResource* const_resource = resource.get();
// Create and queue all image decode tasks that this tile depends on.

Powered by Google App Engine
This is Rietveld 408576698