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

Unified Diff: cc/resources/one_copy_tile_task_worker_pool.cc

Issue 860813002: Remove the default format from ResourcePool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove ResourceFormat from TileManager and call TileTaskRunner::GetResourceFormat() directly instea… 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
« no previous file with comments | « cc/resources/one_copy_tile_task_worker_pool.h ('k') | cc/resources/pixel_buffer_tile_task_worker_pool.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/one_copy_tile_task_worker_pool.cc
diff --git a/cc/resources/one_copy_tile_task_worker_pool.cc b/cc/resources/one_copy_tile_task_worker_pool.cc
index d4a333fe0eccd7b8845014fb635f0c5be314f4d2..b75da5f75c4bbd95912e29c25b8ab678b12ec9f6 100644
--- a/cc/resources/one_copy_tile_task_worker_pool.cc
+++ b/cc/resources/one_copy_tile_task_worker_pool.cc
@@ -25,14 +25,14 @@ class RasterBufferImpl : public RasterBuffer {
RasterBufferImpl(OneCopyTileTaskWorkerPool* worker_pool,
ResourceProvider* resource_provider,
ResourcePool* resource_pool,
+ ResourceFormat resource_format,
const Resource* resource)
: worker_pool_(worker_pool),
resource_provider_(resource_provider),
resource_pool_(resource_pool),
resource_(resource),
raster_resource_(
- resource_pool->AcquireResource(resource->size(),
- resource_pool->default_format())),
+ resource_pool->AcquireResource(resource->size(), resource_format)),
lock_(new ResourceProvider::ScopedWriteLockGpuMemoryBuffer(
resource_provider_,
raster_resource_->id())),
@@ -249,11 +249,17 @@ void OneCopyTileTaskWorkerPool::CheckForCompletedTasks() {
completed_tasks_.clear();
}
+ResourceFormat OneCopyTileTaskWorkerPool::GetResourceFormat() {
+ return resource_provider_->best_texture_format();
+}
+
scoped_ptr<RasterBuffer> OneCopyTileTaskWorkerPool::AcquireBufferForRaster(
const Resource* resource) {
- DCHECK_EQ(resource->format(), resource_pool_->default_format());
+ DCHECK_EQ(resource->format(), resource_provider_->best_texture_format());
return make_scoped_ptr<RasterBuffer>(
- new RasterBufferImpl(this, resource_provider_, resource_pool_, resource));
+ new RasterBufferImpl(this, resource_provider_, resource_pool_,
+ resource_provider_->best_texture_format(),
+ resource));
}
void OneCopyTileTaskWorkerPool::ReleaseBufferForRaster(
« no previous file with comments | « cc/resources/one_copy_tile_task_worker_pool.h ('k') | cc/resources/pixel_buffer_tile_task_worker_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698