| 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 | 9 |
| 10 #include "base/containers/scoped_ptr_map.h" | 10 #include "base/containers/scoped_ptr_map.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 ResourceProvider* resource_provider, | 32 ResourceProvider* resource_provider, |
| 33 base::SingleThreadTaskRunner* task_runner, | 33 base::SingleThreadTaskRunner* task_runner, |
| 34 GLenum target) { | 34 GLenum target) { |
| 35 DCHECK_NE(0u, target); | 35 DCHECK_NE(0u, target); |
| 36 return make_scoped_ptr( | 36 return make_scoped_ptr( |
| 37 new ResourcePool(resource_provider, task_runner, target)); | 37 new ResourcePool(resource_provider, task_runner, target)); |
| 38 } | 38 } |
| 39 | 39 |
| 40 ~ResourcePool() override; | 40 ~ResourcePool() override; |
| 41 | 41 |
| 42 Resource* AcquireResource(const gfx::Size& size, ResourceFormat format); | 42 Resource* AcquireResource(const gfx::Size& desired_size, |
| 43 ResourceFormat format); |
| 43 Resource* TryAcquireResourceWithContentId(uint64 content_id); | 44 Resource* TryAcquireResourceWithContentId(uint64 content_id); |
| 44 void ReleaseResource(Resource* resource, uint64_t content_id); | 45 void ReleaseResource(Resource* resource, uint64_t content_id); |
| 45 | 46 |
| 46 void SetResourceUsageLimits(size_t max_memory_usage_bytes, | 47 void SetResourceUsageLimits(size_t max_memory_usage_bytes, |
| 47 size_t max_resource_count); | 48 size_t max_resource_count); |
| 48 | 49 |
| 49 void ReduceResourceUsage(); | 50 void ReduceResourceUsage(); |
| 50 void CheckBusyResources(); | 51 void CheckBusyResources(); |
| 51 | 52 |
| 52 size_t memory_usage_bytes() const { return in_use_memory_usage_bytes_; } | 53 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... |
| 130 base::TimeDelta resource_expiration_delay_; | 131 base::TimeDelta resource_expiration_delay_; |
| 131 | 132 |
| 132 base::WeakPtrFactory<ResourcePool> weak_ptr_factory_; | 133 base::WeakPtrFactory<ResourcePool> weak_ptr_factory_; |
| 133 | 134 |
| 134 DISALLOW_COPY_AND_ASSIGN(ResourcePool); | 135 DISALLOW_COPY_AND_ASSIGN(ResourcePool); |
| 135 }; | 136 }; |
| 136 | 137 |
| 137 } // namespace cc | 138 } // namespace cc |
| 138 | 139 |
| 139 #endif // CC_RESOURCES_RESOURCE_POOL_H_ | 140 #endif // CC_RESOURCES_RESOURCE_POOL_H_ |
| OLD | NEW |