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

Unified Diff: cc/resources/resource_pool.cc

Issue 2507963003: Pass correct texture hint for GPU raster (Closed)
Patch Set: rebase Created 4 years, 1 month 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/resources/resource_pool.h ('k') | cc/resources/resource_pool_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_pool.cc
diff --git a/cc/resources/resource_pool.cc b/cc/resources/resource_pool.cc
index 3fc3993aea2be3585dbdf116db46c9ce3dd76d0f..8041d8de46d065e1ab43029db3b1b2210b6d4e2d 100644
--- a/cc/resources/resource_pool.cc
+++ b/cc/resources/resource_pool.cc
@@ -55,17 +55,29 @@ void ResourcePool::PoolResource::OnMemoryDump(
ResourcePool::ResourcePool(ResourceProvider* resource_provider,
base::SingleThreadTaskRunner* task_runner,
- bool use_gpu_memory_buffers,
+ gfx::BufferUsage usage,
const base::TimeDelta& expiration_delay)
: resource_provider_(resource_provider),
- use_gpu_memory_buffers_(use_gpu_memory_buffers),
- max_memory_usage_bytes_(0),
- max_resource_count_(0),
- in_use_memory_usage_bytes_(0),
- total_memory_usage_bytes_(0),
- total_resource_count_(0),
+ use_gpu_memory_buffers_(true),
+ usage_(usage),
+ task_runner_(task_runner),
+ resource_expiration_delay_(expiration_delay),
+ weak_ptr_factory_(this) {
+ base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
+ this, "cc::ResourcePool", task_runner_.get());
+
+ // Register this component with base::MemoryCoordinatorClientRegistry.
+ base::MemoryCoordinatorClientRegistry::GetInstance()->Register(this);
+}
+
+ResourcePool::ResourcePool(ResourceProvider* resource_provider,
+ base::SingleThreadTaskRunner* task_runner,
+ ResourceProvider::TextureHint hint,
+ const base::TimeDelta& expiration_delay)
+ : resource_provider_(resource_provider),
+ use_gpu_memory_buffers_(false),
+ hint_(hint),
task_runner_(task_runner),
- evict_expired_resources_pending_(false),
resource_expiration_delay_(expiration_delay),
weak_ptr_factory_(this) {
base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
@@ -132,8 +144,7 @@ Resource* ResourcePool::CreateResource(const gfx::Size& size,
pool_resource->AllocateWithGpuMemoryBuffer(size, format, usage_,
color_space);
} else {
- pool_resource->Allocate(size, ResourceProvider::TEXTURE_HINT_IMMUTABLE,
- format, color_space);
+ pool_resource->Allocate(size, hint_, format, color_space);
}
DCHECK(ResourceUtil::VerifySizeInBytes<size_t>(pool_resource->size(),
« no previous file with comments | « cc/resources/resource_pool.h ('k') | cc/resources/resource_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698