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

Unified Diff: cc/resources/resource_pool.h

Issue 2507963003: Pass correct texture hint for GPU raster (Closed)
Patch Set: 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 | « no previous file | cc/resources/resource_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_pool.h
diff --git a/cc/resources/resource_pool.h b/cc/resources/resource_pool.h
index a1bd9d696cb14933dcdd1d63d5d3e4aef5117dd1..059c6a2df87f5d174ee91a7d8c21f3e6bbcc0f8b 100644
--- a/cc/resources/resource_pool.h
+++ b/cc/resources/resource_pool.h
@@ -34,18 +34,17 @@ class CC_EXPORT ResourcePool : public base::trace_event::MemoryDumpProvider,
base::SingleThreadTaskRunner* task_runner,
gfx::BufferUsage usage,
const base::TimeDelta& expiration_delay) {
- std::unique_ptr<ResourcePool> pool(new ResourcePool(
- resource_provider, task_runner, true, expiration_delay));
- pool->usage_ = usage;
- return pool;
+ return base::WrapUnique(new ResourcePool(resource_provider, task_runner,
+ usage, expiration_delay));
}
static std::unique_ptr<ResourcePool> Create(
ResourceProvider* resource_provider,
base::SingleThreadTaskRunner* task_runner,
+ ResourceProvider::TextureHint hint,
const base::TimeDelta& expiration_delay) {
return base::WrapUnique(new ResourcePool(resource_provider, task_runner,
- false, expiration_delay));
+ hint, expiration_delay));
}
~ResourcePool() override;
@@ -99,9 +98,16 @@ class CC_EXPORT ResourcePool : public base::trace_event::MemoryDumpProvider,
}
protected:
+ // Constructor for creating GPU memory buffer resources.
+ ResourcePool(ResourceProvider* resource_provider,
+ base::SingleThreadTaskRunner* task_runner,
+ gfx::BufferUsage usage,
+ const base::TimeDelta& expiration_delay);
+
+ // Constructor for creating standard resources.
ResourcePool(ResourceProvider* resource_provider,
base::SingleThreadTaskRunner* task_runner,
- bool use_gpu_memory_buffers,
+ ResourceProvider::TextureHint hint,
const base::TimeDelta& expiration_delay);
bool ResourceUsageTooHigh();
@@ -164,11 +170,12 @@ class CC_EXPORT ResourcePool : public base::trace_event::MemoryDumpProvider,
ResourceProvider* resource_provider_;
vmpstr 2016/11/17 19:17:56 While here, do you mind initializing these as well
bool use_gpu_memory_buffers_;
gfx::BufferUsage usage_;
- size_t max_memory_usage_bytes_;
- size_t max_resource_count_;
- size_t in_use_memory_usage_bytes_;
- size_t total_memory_usage_bytes_;
- size_t total_resource_count_;
+ ResourceProvider::TextureHint hint_;
+ size_t max_memory_usage_bytes_ = 0;
+ size_t max_resource_count_ = 0;
+ size_t in_use_memory_usage_bytes_ = 0;
+ size_t total_memory_usage_bytes_ = 0;
+ size_t total_resource_count_ = 0;
// Holds most recently used resources at the front of the queue.
using ResourceDeque = std::deque<std::unique_ptr<PoolResource>>;
@@ -179,7 +186,7 @@ class CC_EXPORT ResourcePool : public base::trace_event::MemoryDumpProvider,
InUseResourceMap in_use_resources_;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
- bool evict_expired_resources_pending_;
+ bool evict_expired_resources_pending_ = false;
const base::TimeDelta resource_expiration_delay_;
base::WeakPtrFactory<ResourcePool> weak_ptr_factory_;
« no previous file with comments | « no previous file | cc/resources/resource_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698