| Index: src/gpu/GrResourceCache2.h
|
| diff --git a/src/gpu/GrResourceCache2.h b/src/gpu/GrResourceCache2.h
|
| index 805d359eb4e0061f9a7177ec2b759b5f426959e2..b0394e3c63352f2bc7263c14ac7dc4a2184e7edc 100644
|
| --- a/src/gpu/GrResourceCache2.h
|
| +++ b/src/gpu/GrResourceCache2.h
|
| @@ -47,16 +47,26 @@ public:
|
| void setLimits(int count, size_t bytes);
|
|
|
| /**
|
| - * Returns the number of cached resources.
|
| + * Returns the number of resources.
|
| */
|
| int getResourceCount() const { return fCount; }
|
|
|
| /**
|
| - * Returns the number of bytes consumed by cached resources.
|
| + * Returns the number of resources that count against the budget.
|
| + */
|
| + int getBudgetedResourceCount() const { return fBudgetedCount; }
|
| +
|
| + /**
|
| + * Returns the number of bytes consumed by resources.
|
| */
|
| size_t getResourceBytes() const { return fBytes; }
|
|
|
| /**
|
| + * Returns the number of bytes consumed by budgeted resources.
|
| + */
|
| + size_t getBudgetedResourceBytes() const { return fBudgetedBytes; }
|
| +
|
| + /**
|
| * Returns the cached resources count budget.
|
| */
|
| int getMaxResourceCount() const { return fMaxCount; }
|
| @@ -155,7 +165,7 @@ private:
|
| /// @}
|
|
|
| void purgeAsNeeded() {
|
| - if (fPurging || (fCount <= fMaxCount && fBytes < fMaxBytes)) {
|
| + if (fPurging || (fBudgetedCount <= fMaxCount && fBudgetedBytes < fMaxBytes)) {
|
| return;
|
| }
|
| this->internalPurgeAsNeeded();
|
| @@ -207,12 +217,18 @@ private:
|
| #if GR_CACHE_STATS
|
| int fHighWaterCount;
|
| size_t fHighWaterBytes;
|
| + int fBudgetedHighWaterCount;
|
| + size_t fBudgetedHighWaterBytes;
|
| #endif
|
|
|
| - // our current stats, related to our budget
|
| + // our current stats for all resources
|
| int fCount;
|
| size_t fBytes;
|
|
|
| + // our current stats for resources that count against the budget
|
| + int fBudgetedCount;
|
| + size_t fBudgetedBytes;
|
| +
|
| // prevents recursive purging
|
| bool fPurging;
|
| bool fNewlyPurgableResourceWhilePurging;
|
|
|