| Index: src/gpu/GrResourceCache.h
|
| diff --git a/src/gpu/GrResourceCache.h b/src/gpu/GrResourceCache.h
|
| index 5483e1900c9add6512be7d406c0a8bf27e2a5f63..809c4f491e0ae3ba857cfc6668036dc61966d453 100644
|
| --- a/src/gpu/GrResourceCache.h
|
| +++ b/src/gpu/GrResourceCache.h
|
| @@ -126,7 +126,9 @@ public:
|
| /**
|
| * Find a resource that matches a scratch key.
|
| */
|
| - GrGpuResource* findAndRefScratchResource(const GrScratchKey& scratchKey, uint32_t flags = 0);
|
| + GrGpuResource* findAndRefScratchResource(const GrScratchKey& scratchKey,
|
| + size_t resourceSize,
|
| + uint32_t flags);
|
|
|
| #ifdef SK_DEBUG
|
| // This is not particularly fast and only used for validation, so debug only.
|
| @@ -206,6 +208,10 @@ private:
|
| void removeFromNonpurgeableArray(GrGpuResource*);
|
| bool overBudget() const { return fBudgetedBytes > fMaxBytes || fBudgetedCount > fMaxCount; }
|
|
|
| + bool wouldFit(size_t bytes) {
|
| + return fBudgetedBytes+bytes <= fMaxBytes && fBudgetedCount+1 <= fMaxCount;
|
| + }
|
| +
|
| uint32_t getNextTimestamp();
|
|
|
| #ifdef SK_DEBUG
|
|
|