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

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: 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/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..e62ddfd4727e8df3e1144b5784f36635084dbba5 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())),
@@ -135,6 +135,8 @@ OneCopyTileTaskWorkerPool::OneCopyTileTaskWorkerPool(
weak_ptr_factory_(this),
task_set_finished_weak_ptr_factory_(this) {
DCHECK(context_provider_);
+ DCHECK(resource_provider_);
+ resource_format_ = resource_provider_->best_texture_format();
}
OneCopyTileTaskWorkerPool::~OneCopyTileTaskWorkerPool() {
@@ -145,6 +147,10 @@ TileTaskRunner* OneCopyTileTaskWorkerPool::AsTileTaskRunner() {
return this;
}
+ResourceFormat OneCopyTileTaskWorkerPool::GetResourceFormat() {
+ return resource_format_;
+}
+
void OneCopyTileTaskWorkerPool::SetClient(TileTaskRunnerClient* client) {
client_ = client;
}
@@ -251,9 +257,10 @@ void OneCopyTileTaskWorkerPool::CheckForCompletedTasks() {
scoped_ptr<RasterBuffer> OneCopyTileTaskWorkerPool::AcquireBufferForRaster(
const Resource* resource) {
- DCHECK_EQ(resource->format(), resource_pool_->default_format());
+ DCHECK_EQ(resource->format(), resource_format_);
return make_scoped_ptr<RasterBuffer>(
- new RasterBufferImpl(this, resource_provider_, resource_pool_, resource));
+ new RasterBufferImpl(this, resource_provider_, resource_pool_,
+ resource_format_, resource));
}
void OneCopyTileTaskWorkerPool::ReleaseBufferForRaster(

Powered by Google App Engine
This is Rietveld 408576698