Index: cc/raster/zero_copy_tile_task_worker_pool.cc |
diff --git a/cc/raster/zero_copy_tile_task_worker_pool.cc b/cc/raster/zero_copy_tile_task_worker_pool.cc |
index 4310f96b27ddf5ffea214d97a1fee047055500ed..1fd8e3d5d6bef25312e66a2489b3dae2b49dc3fe 100644 |
--- a/cc/raster/zero_copy_tile_task_worker_pool.cc |
+++ b/cc/raster/zero_copy_tile_task_worker_pool.cc |
@@ -68,22 +68,22 @@ scoped_ptr<TileTaskWorkerPool> ZeroCopyTileTaskWorkerPool::Create( |
base::SequencedTaskRunner* task_runner, |
TaskGraphRunner* task_graph_runner, |
ResourceProvider* resource_provider, |
- bool use_rgba_4444_texture_format) { |
- return make_scoped_ptr<TileTaskWorkerPool>(new ZeroCopyTileTaskWorkerPool( |
- task_runner, task_graph_runner, resource_provider, |
- use_rgba_4444_texture_format)); |
+ ResourceFormat preferred_tile_format) { |
+ return make_scoped_ptr<TileTaskWorkerPool>( |
+ new ZeroCopyTileTaskWorkerPool(task_runner, task_graph_runner, |
+ resource_provider, preferred_tile_format)); |
} |
ZeroCopyTileTaskWorkerPool::ZeroCopyTileTaskWorkerPool( |
base::SequencedTaskRunner* task_runner, |
TaskGraphRunner* task_graph_runner, |
ResourceProvider* resource_provider, |
- bool use_rgba_4444_texture_format) |
+ ResourceFormat preferred_tile_format) |
: task_runner_(task_runner), |
task_graph_runner_(task_graph_runner), |
namespace_token_(task_graph_runner->GetNamespaceToken()), |
resource_provider_(resource_provider), |
- use_rgba_4444_texture_format_(use_rgba_4444_texture_format) {} |
+ preferred_tile_format_(preferred_tile_format) {} |
ZeroCopyTileTaskWorkerPool::~ZeroCopyTileTaskWorkerPool() { |
} |
@@ -125,9 +125,13 @@ void ZeroCopyTileTaskWorkerPool::CheckForCompletedTasks() { |
ResourceFormat ZeroCopyTileTaskWorkerPool::GetResourceFormat( |
bool must_support_alpha) const { |
- return use_rgba_4444_texture_format_ |
- ? RGBA_4444 |
- : resource_provider_->best_texture_format(); |
+ if (resource_provider_->IsResourceFormatSupported(preferred_tile_format_) && |
+ (DoesResourceFormatSupportAlpha(preferred_tile_format_) || |
+ !must_support_alpha)) { |
+ return preferred_tile_format_; |
+ } |
+ |
+ return resource_provider_->best_texture_format(); |
} |
bool ZeroCopyTileTaskWorkerPool::GetResourceRequiresSwizzle( |