| Index: cc/resources/resource_pool.cc
|
| diff --git a/cc/resources/resource_pool.cc b/cc/resources/resource_pool.cc
|
| index 778ddbe853ca87dc4f194643d7c44bf62c6788bb..ca07646707367b6d915a570ac2d31313f620bac6 100644
|
| --- a/cc/resources/resource_pool.cc
|
| +++ b/cc/resources/resource_pool.cc
|
| @@ -90,8 +90,16 @@ ResourcePool::~ResourcePool() {
|
| DCHECK_EQ(0u, total_resource_count_);
|
| }
|
|
|
| -Resource* ResourcePool::AcquireResource(const gfx::Size& size,
|
| +Resource* ResourcePool::AcquireResource(const gfx::Size& desired_size,
|
| ResourceFormat format) {
|
| + gfx::Size size = desired_size;
|
| + if (IsResourceFormatCompressed(format) &&
|
| + (size.width() % 4 != 0 || size.height() % 4 != 0)) {
|
| + // Round the size up to the nearest multiple of four.
|
| + size.SetSize(4 * std::ceil(static_cast<float>(size.width()) / 4),
|
| + 4 * std::ceil(static_cast<float>(size.height()) / 4));
|
| + }
|
| +
|
| // Finding resources in |unused_resources_| from MRU to LRU direction, touches
|
| // LRU resources only if needed, which increases possibility of expiring more
|
| // LRU resources within kResourceExpirationDelayMs.
|
|
|