Revert "ccpr: Unregister path listeners when their cache entries are evicted"
This reverts commit f30e49310fb8927d1acbfd39f6bdc5513aa7daa1.
Reason for revert: Slow down on skps across multiple bots and configs
Original change's description:
> ccpr: Unregister path listeners when their cache entries are evicted
>
> Bug: skia:8452
> Change-Id: I5cf63c07481db38fc37e920e04ca140bad8966e4
> Reviewed-on: https://skia-review.googlesource.com/c/163560
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=bsalomon@google.com,brianosman@google.com,csmartdalton@google.com
Change-Id: I1f9859a02d9c78e4a83e68c6b26fd8d3badd2d8e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8452
Reviewed-on: https://skia-review.googlesource.com/c/163787
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/ccpr/GrCCPathCache.cpp b/src/gpu/ccpr/GrCCPathCache.cpp
index 32008c2..db85641 100644
--- a/src/gpu/ccpr/GrCCPathCache.cpp
+++ b/src/gpu/ccpr/GrCCPathCache.cpp
@@ -187,15 +187,12 @@
}
void GrCCPathCache::evict(GrCCPathCacheEntry* entry) {
- // Has the entry already been evicted? (SkPaths can post eviction messages from any thread.)
- if (entry->shouldUnregisterFromPath()) {
- SkASSERT(!fLRU.isInList(entry));
- return;
+ bool isInCache = entry->fNext || (fLRU.tail() == entry);
+ SkASSERT(isInCache == fLRU.isInList(entry));
+ if (isInCache) {
+ fLRU.remove(entry);
+ fHashTable.remove(HashNode::GetKey(entry)); // Do this last, as it might delete the entry.
}
-
- entry->markShouldUnregisterFromPath();
- fLRU.remove(entry);
- fHashTable.remove(HashNode::GetKey(entry)); // Do this last, as it might delete the entry.
}
void GrCCPathCache::purgeAsNeeded() {