| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_RESOURCES_RESOURCE_POOL_H_ | 5 #ifndef CC_RESOURCES_RESOURCE_POOL_H_ |
| 6 #define CC_RESOURCES_RESOURCE_POOL_H_ | 6 #define CC_RESOURCES_RESOURCE_POOL_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 static scoped_ptr<ResourcePool> Create( | 30 static scoped_ptr<ResourcePool> Create( |
| 31 ResourceProvider* resource_provider, | 31 ResourceProvider* resource_provider, |
| 32 base::SingleThreadTaskRunner* task_runner) { | 32 base::SingleThreadTaskRunner* task_runner) { |
| 33 return make_scoped_ptr( | 33 return make_scoped_ptr( |
| 34 new ResourcePool(resource_provider, task_runner, false)); | 34 new ResourcePool(resource_provider, task_runner, false)); |
| 35 } | 35 } |
| 36 | 36 |
| 37 ~ResourcePool() override; | 37 ~ResourcePool() override; |
| 38 | 38 |
| 39 Resource* AcquireResource(const gfx::Size& size, ResourceFormat format); | 39 Resource* AcquireResource(const gfx::Size& desired_size, |
| 40 ResourceFormat format); |
| 40 Resource* TryAcquireResourceWithContentId(uint64 content_id); | 41 Resource* TryAcquireResourceWithContentId(uint64 content_id); |
| 41 void ReleaseResource(Resource* resource, uint64_t content_id); | 42 void ReleaseResource(Resource* resource, uint64_t content_id); |
| 42 | 43 |
| 43 void SetResourceUsageLimits(size_t max_memory_usage_bytes, | 44 void SetResourceUsageLimits(size_t max_memory_usage_bytes, |
| 44 size_t max_resource_count); | 45 size_t max_resource_count); |
| 45 | 46 |
| 46 void ReduceResourceUsage(); | 47 void ReduceResourceUsage(); |
| 47 void CheckBusyResources(); | 48 void CheckBusyResources(); |
| 48 | 49 |
| 49 size_t memory_usage_bytes() const { return in_use_memory_usage_bytes_; } | 50 size_t memory_usage_bytes() const { return in_use_memory_usage_bytes_; } |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 base::TimeDelta resource_expiration_delay_; | 128 base::TimeDelta resource_expiration_delay_; |
| 128 | 129 |
| 129 base::WeakPtrFactory<ResourcePool> weak_ptr_factory_; | 130 base::WeakPtrFactory<ResourcePool> weak_ptr_factory_; |
| 130 | 131 |
| 131 DISALLOW_COPY_AND_ASSIGN(ResourcePool); | 132 DISALLOW_COPY_AND_ASSIGN(ResourcePool); |
| 132 }; | 133 }; |
| 133 | 134 |
| 134 } // namespace cc | 135 } // namespace cc |
| 135 | 136 |
| 136 #endif // CC_RESOURCES_RESOURCE_POOL_H_ | 137 #endif // CC_RESOURCES_RESOURCE_POOL_H_ |
| OLD | NEW |