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

Unified Diff: cc/resources/resource_pool.h

Issue 2726263003: cc::ResourcePool - Re-use larger resources for smaller requests (Closed)
Patch Set: rebase Created 3 years, 7 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
Index: cc/resources/resource_pool.h
diff --git a/cc/resources/resource_pool.h b/cc/resources/resource_pool.h
index 8932364ee4c2239994aa07eabe5df83784169d4d..60dfa07618bd7e0abb5b9f77685248a00a9258c1 100644
--- a/cc/resources/resource_pool.h
+++ b/cc/resources/resource_pool.h
@@ -33,18 +33,22 @@ class CC_EXPORT ResourcePool : public base::trace_event::MemoryDumpProvider,
ResourceProvider* resource_provider,
base::SingleThreadTaskRunner* task_runner,
gfx::BufferUsage usage,
- const base::TimeDelta& expiration_delay) {
+ const base::TimeDelta& expiration_delay,
+ bool disallow_non_exact_reuse) {
return base::WrapUnique(new ResourcePool(resource_provider, task_runner,
- usage, expiration_delay));
+ usage, expiration_delay,
+ disallow_non_exact_reuse));
}
static std::unique_ptr<ResourcePool> Create(
ResourceProvider* resource_provider,
base::SingleThreadTaskRunner* task_runner,
ResourceProvider::TextureHint hint,
- const base::TimeDelta& expiration_delay) {
+ const base::TimeDelta& expiration_delay,
+ bool disallow_non_exact_reuse) {
return base::WrapUnique(new ResourcePool(resource_provider, task_runner,
- hint, expiration_delay));
+ hint, expiration_delay,
+ disallow_non_exact_reuse));
}
~ResourcePool() override;
@@ -102,13 +106,15 @@ class CC_EXPORT ResourcePool : public base::trace_event::MemoryDumpProvider,
ResourcePool(ResourceProvider* resource_provider,
base::SingleThreadTaskRunner* task_runner,
gfx::BufferUsage usage,
- const base::TimeDelta& expiration_delay);
+ const base::TimeDelta& expiration_delay,
+ bool disallow_non_exact_reuse);
// Constructor for creating standard resources.
ResourcePool(ResourceProvider* resource_provider,
base::SingleThreadTaskRunner* task_runner,
ResourceProvider::TextureHint hint,
- const base::TimeDelta& expiration_delay);
+ const base::TimeDelta& expiration_delay,
+ bool disallow_non_exact_reuse);
private:
FRIEND_TEST_ALL_PREFIXES(ResourcePoolTest, ReuseResource);
@@ -186,6 +192,7 @@ class CC_EXPORT ResourcePool : public base::trace_event::MemoryDumpProvider,
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
bool evict_expired_resources_pending_ = false;
const base::TimeDelta resource_expiration_delay_;
+ const bool disallow_non_exact_reuse_ = false;
base::WeakPtrFactory<ResourcePool> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698