| Index: src/gpu/GrResourceCache.cpp
|
| diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp
|
| index 88128ac5000fdfb651b21d0ca2f39751f6738be1..7efe62365bf432f112e12e5a01d9b97fa4f7ec98 100644
|
| --- a/src/gpu/GrResourceCache.cpp
|
| +++ b/src/gpu/GrResourceCache.cpp
|
| @@ -246,6 +246,7 @@ private:
|
| };
|
|
|
| GrGpuResource* GrResourceCache::findAndRefScratchResource(const GrScratchKey& scratchKey,
|
| + size_t resourceSize,
|
| uint32_t flags) {
|
| SkASSERT(scratchKey.isValid());
|
|
|
| @@ -259,8 +260,11 @@ GrGpuResource* GrResourceCache::findAndRefScratchResource(const GrScratchKey& sc
|
| } else if (flags & kRequireNoPendingIO_ScratchFlag) {
|
| return NULL;
|
| }
|
| - // TODO: fail here when kPrefer is specified, we didn't find a resource without pending io,
|
| - // but there is still space in our budget for the resource.
|
| + if (this->wouldFit(resourceSize)) {
|
| + // kPrefer is specified, we didn't find a resource without pending io,
|
| + // but there is still space in our budget for the resource.
|
| + return NULL;
|
| + }
|
| }
|
| resource = fScratchMap.find(scratchKey, AvailableForScratchUse(false));
|
| if (resource) {
|
|
|