diff options
author | bsalomon <bsalomon@google.com> | 2015-01-14 10:42:08 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-14 10:42:08 -0800 |
commit | 5236cf480daf82b2f36e42795abdbbc915533a59 (patch) | |
tree | b3e76998aabf4849c60d7bc0c701de47b2aaf4e9 /src/gpu/GrGpuResourceCacheAccess.h | |
parent | 028b98a08072bd1764936e47c54fa2da5cf92744 (diff) |
Make uncached textures uncached from the get go.
This avoids the problem of a newly created uncached texture causing a purge of cached resources.
BUG=chromium:445885
Review URL: https://codereview.chromium.org/846303002
Diffstat (limited to 'src/gpu/GrGpuResourceCacheAccess.h')
-rw-r--r-- | src/gpu/GrGpuResourceCacheAccess.h | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/gpu/GrGpuResourceCacheAccess.h b/src/gpu/GrGpuResourceCacheAccess.h index 475317ddb2..0aadb89d97 100644 --- a/src/gpu/GrGpuResourceCacheAccess.h +++ b/src/gpu/GrGpuResourceCacheAccess.h @@ -29,11 +29,6 @@ public: } /** - * Changes whether the resource counts against the resource cache budget. - */ - void setBudgeted(bool countsAgainstBudget) { fResource->setBudgeted(countsAgainstBudget); } - - /** * Is the resource currently cached as scratch? This means it has a valid scratch key and does * not have a content key. */ @@ -67,16 +62,12 @@ public: /** * Is the resource object wrapping an externally allocated GPU resource? */ - bool isWrapped() const { return fResource->isWrapped(); } + bool isWrapped() const { return GrGpuResource::kWrapped_LifeCycle == fResource->fLifeCycle; } /** * Does the resource count against the resource budget? */ - bool isBudgeted() const { - bool ret = SkToBool(GrGpuResource::kBudgeted_Flag & fResource->fFlags); - SkASSERT(!(ret && fResource->isWrapped())); - return ret; - } + bool isBudgeted() const { return GrGpuResource::kCached_LifeCycle == fResource->fLifeCycle; } /** * Called by the cache to delete the resource under normal circumstances. |