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

Unified Diff: cc/raster/zero_copy_tile_task_worker_pool.cc

Issue 1713503002: Reland Allow one-copy and zero-copy task tile worker pools to use compressed textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 10 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/raster/zero_copy_tile_task_worker_pool.h ('k') | cc/resources/platform_color.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « cc/raster/zero_copy_tile_task_worker_pool.h ('k') | cc/resources/platform_color.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698