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 147eeca64f82f5d9f8848bd725273e24df830b2f..c96399c5e92473ffd585a5d72c8a6f87ebd23d8c 100644 |
--- a/cc/raster/zero_copy_tile_task_worker_pool.cc |
+++ b/cc/raster/zero_copy_tile_task_worker_pool.cc |
@@ -65,22 +65,25 @@ scoped_ptr<TileTaskWorkerPool> ZeroCopyTileTaskWorkerPool::Create( |
base::SequencedTaskRunner* task_runner, |
TaskGraphRunner* task_graph_runner, |
ResourceProvider* resource_provider, |
- bool use_rgba_4444_texture_format) { |
+ ResourceFormat memory_efficient_format, |
+ ResourceFormat memory_efficient_format_with_alpha) { |
return make_scoped_ptr<TileTaskWorkerPool>(new ZeroCopyTileTaskWorkerPool( |
task_runner, task_graph_runner, resource_provider, |
- use_rgba_4444_texture_format)); |
+ memory_efficient_format, memory_efficient_format_with_alpha)); |
} |
ZeroCopyTileTaskWorkerPool::ZeroCopyTileTaskWorkerPool( |
base::SequencedTaskRunner* task_runner, |
TaskGraphRunner* task_graph_runner, |
ResourceProvider* resource_provider, |
- bool use_rgba_4444_texture_format) |
+ ResourceFormat memory_efficient_format, |
+ ResourceFormat memory_efficient_format_with_alpha) |
: 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), |
+ memory_efficient_format_(memory_efficient_format), |
+ memory_efficient_format_with_alpha_(memory_efficient_format_with_alpha), |
task_set_finished_weak_ptr_factory_(this) {} |
ZeroCopyTileTaskWorkerPool::~ZeroCopyTileTaskWorkerPool() { |
@@ -183,9 +186,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 (memory_efficient_format_with_alpha_ != RGBA_8888 && must_support_alpha) |
+ return memory_efficient_format_with_alpha_; |
+ |
+ if (memory_efficient_format_ != RGBA_8888 && !must_support_alpha) |
+ return memory_efficient_format_; |
+ |
+ return resource_provider_->best_texture_format(); |
} |
bool ZeroCopyTileTaskWorkerPool::GetResourceRequiresSwizzle( |