aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrResourceCache.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-03-22 14:59:02 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-22 14:59:07 +0000
commit20c322ef0cd04cf8e2592879d05d9f4e6cb19596 (patch)
tree3dd86434ae8c1f636f5e29dcae947c595840bd4b /src/gpu/GrResourceCache.cpp
parentfbb56ce83fc717b7c6722324bbccd1ae73c350a4 (diff)
Revert "Add a new GrResourceCache purging mechanism for purging unused resources."
This reverts commit fbb56ce83fc717b7c6722324bbccd1ae73c350a4. Reason for revert: Chrome's ancient libstdc++ doesn't like use of steady_clock Original change's description: > Add a new GrResourceCache purging mechanism for purging unused resources. > > The client may call GrContext::purgeResourceNotUsedSince() with a stead_clock::time_point and all resources that have been purgeable since before that time point are purged. > > This is intended to replace the "max unused flushes" purging mechanism once Chrome adopts it. > > Change-Id: I28881dd2959cc01c0acca81b2d6001ee5626439d > Reviewed-on: https://skia-review.googlesource.com/8920 > Commit-Queue: Brian Salomon <bsalomon@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> > Reviewed-by: Eric Karl <ericrk@google.com> > TBR=bsalomon@google.com,robertphillips@google.com,ericrk@google.com,reviews@skia.org,ericrk@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I3baa3b2e80302315b757d4d625732459e13795d4 Reviewed-on: https://skia-review.googlesource.com/10004 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrResourceCache.cpp')
-rw-r--r--src/gpu/GrResourceCache.cpp19
1 files changed, 0 insertions, 19 deletions
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp
index 97d3b96808..9462a7384d 100644
--- a/src/gpu/GrResourceCache.cpp
+++ b/src/gpu/GrResourceCache.cpp
@@ -365,7 +365,6 @@ void GrResourceCache::notifyCntReachedZero(GrGpuResource* resource, uint32_t fla
this->removeFromNonpurgeableArray(resource);
fPurgeableQueue.insert(resource);
resource->cacheAccess().setFlushCntWhenResourceBecamePurgeable(fExternalFlushCnt);
- resource->cacheAccess().setTimeWhenResourceBecomePurgeable();
if (SkBudgeted::kNo == resource->resourcePriv().isBudgeted()) {
// Check whether this resource could still be used as a scratch resource.
@@ -505,24 +504,6 @@ void GrResourceCache::purgeAllUnlocked() {
this->validate();
}
-void GrResourceCache::purgeResourcesNotUsedSince(std::chrono::steady_clock::time_point purgeTime) {
- while (fPurgeableQueue.count()) {
- const std::chrono::steady_clock::time_point resourceTime =
- fPurgeableQueue.peek()->cacheAccess().timeWhenResourceBecamePurgeable();
- if (resourceTime >= purgeTime) {
- // Resources were given both LRU timestamps and tagged with a frame number when
- // they first became purgeable. The LRU timestamp won't change again until the
- // resource is made non-purgeable again. So, at this point all the remaining
- // resources in the timestamp-sorted queue will have a frame number >= to this
- // one.
- break;
- }
- GrGpuResource* resource = fPurgeableQueue.peek();
- SkASSERT(resource->isPurgeable());
- resource->cacheAccess().release();
- }
-}
-
void GrResourceCache::processInvalidUniqueKeys(
const SkTArray<GrUniqueKeyInvalidatedMessage>& msgs) {
for (int i = 0; i < msgs.count(); ++i) {