Index: cc/resources/resource_pool.cc |
diff --git a/cc/resources/resource_pool.cc b/cc/resources/resource_pool.cc |
index f5c71678f2740a5966f41958c08a0bf49f77ae70..d60d0b130accdba8ca2e6787a41efb614a44cbca 100644 |
--- a/cc/resources/resource_pool.cc |
+++ b/cc/resources/resource_pool.cc |
@@ -5,6 +5,7 @@ |
#include "cc/resources/resource_pool.h" |
#include "cc/resources/resource_provider.h" |
+#include "cc/resources/resource_util.h" |
#include "cc/resources/scoped_resource.h" |
namespace cc { |
@@ -48,7 +49,7 @@ scoped_ptr<ScopedResource> ResourcePool::AcquireResource( |
unused_resources_.erase(it); |
unused_memory_usage_bytes_ -= |
- Resource::UncheckedMemorySizeBytes(size, format); |
+ ResourceUtil::UncheckedSizeInBytes(size, format); |
return make_scoped_ptr(resource); |
} |
@@ -56,9 +57,10 @@ scoped_ptr<ScopedResource> ResourcePool::AcquireResource( |
ScopedResource::Create(resource_provider_); |
resource->AllocateManaged(size, target_, format); |
- DCHECK(Resource::VerifySizeInBytes(resource->size(), resource->format())); |
+ DCHECK(ResourceUtil::VerifySizeInBytes<size_t>(resource->size(), |
+ resource->format())); |
memory_usage_bytes_ += |
- Resource::UncheckedMemorySizeBytes(resource->size(), resource->format()); |
+ ResourceUtil::UncheckedSizeInBytes(resource->size(), resource->format()); |
++resource_count_; |
return resource.Pass(); |
} |
@@ -79,7 +81,7 @@ scoped_ptr<ScopedResource> ResourcePool::TryAcquireResourceWithContentId( |
unused_resources_.erase(it); |
unused_memory_usage_bytes_ -= |
- Resource::UncheckedMemorySizeBytes(resource->size(), resource->format()); |
+ ResourceUtil::UncheckedSizeInBytes(resource->size(), resource->format()); |
return make_scoped_ptr(resource); |
} |
@@ -112,7 +114,7 @@ void ResourcePool::ReduceResourceUsage() { |
// memory is necessarily returned to the OS. |
ScopedResource* resource = unused_resources_.front().resource; |
unused_resources_.pop_front(); |
- size_t resource_bytes = Resource::UncheckedMemorySizeBytes( |
+ size_t resource_bytes = ResourceUtil::UncheckedSizeInBytes( |
resource->size(), resource->format()); |
memory_usage_bytes_ -= resource_bytes; |
unused_memory_usage_bytes_ -= resource_bytes; |
@@ -152,7 +154,7 @@ void ResourcePool::CheckBusyResources(bool wait_if_needed) { |
void ResourcePool::DidFinishUsingResource(ScopedResource* resource, |
uint64_t content_id) { |
unused_memory_usage_bytes_ += |
- Resource::UncheckedMemorySizeBytes(resource->size(), resource->format()); |
+ ResourceUtil::UncheckedSizeInBytes(resource->size(), resource->format()); |
unused_resources_.push_back(PoolResource(resource, content_id)); |
} |