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( |