diff options
author | Robert Phillips <robertphillips@google.com> | 2017-11-16 07:52:08 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-11-16 16:35:57 +0000 |
commit | eafd48af63aef270cbea139547bb4fa8a591748d (patch) | |
tree | c59febed663b2e00ab9af5eb8ad239a3efded290 /src/gpu/GrResourceCache.h | |
parent | 5627d65146cb92624b682389e017d488872228c7 (diff) |
Add overbudget handling to GrResourceAllocator
Change-Id: I5536c908310e907c77b5d55441a0edac6a74bf0e
Reviewed-on: https://skia-review.googlesource.com/71182
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrResourceCache.h')
-rw-r--r-- | src/gpu/GrResourceCache.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gpu/GrResourceCache.h b/src/gpu/GrResourceCache.h index 94245328f1..54be56d64a 100644 --- a/src/gpu/GrResourceCache.h +++ b/src/gpu/GrResourceCache.h @@ -246,6 +246,8 @@ public: /** Purge all resources not used since the passed in time. */ void purgeResourcesNotUsedSince(GrStdSteadyClock::time_point); + bool overBudget() const { return fBudgetedBytes > fMaxBytes || fBudgetedCount > fMaxCount; } + /** * Purge unlocked resources from the cache until the the provided byte count has been reached * or we have purged all unlocked resources. The default policy is to purge in LRU order, but @@ -343,7 +345,6 @@ private: void processFreedGpuResources(); void addToNonpurgeableArray(GrGpuResource*); void removeFromNonpurgeableArray(GrGpuResource*); - bool overBudget() const { return fBudgetedBytes > fMaxBytes || fBudgetedCount > fMaxCount; } bool wouldFit(size_t bytes) { return fBudgetedBytes+bytes <= fMaxBytes && fBudgetedCount+1 <= fMaxCount; |