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

Unified Diff: cc/resources/resource_pool.h

Issue 2726263003: cc::ResourcePool - Re-use larger resources for smaller requests (Closed)
Patch Set: fix compile 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
« no previous file with comments | « cc/raster/one_copy_raster_buffer_provider.cc ('k') | 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 8932364ee4c2239994aa07eabe5df83784169d4d..33291874d261c16202666d7e6a859b18650d5189 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,16 +106,19 @@ 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);
+ FRIEND_TEST_ALL_PREFIXES(ResourcePoolTest, ExactRequestsRespected);
class PoolResource : public ScopedResource {
public:
static std::unique_ptr<PoolResource> Create(
@@ -186,6 +193,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_;
« no previous file with comments | « cc/raster/one_copy_raster_buffer_provider.cc ('k') | cc/resources/resource_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698