diff options
author | mtklein <mtklein@google.com> | 2015-02-19 08:53:52 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-19 08:53:52 -0800 |
commit | 90c6bc4e85df2da37f436ea1da203e194c4740e2 (patch) | |
tree | bc71dc3d3a7160bb8118a1e349e11a6e58a4b8cb /src/core/SkResourceCache.cpp | |
parent | cabc08c4296e1ce6c6d9d84cf702361cf439c1bc (diff) |
Revert of notify resource caches when pixelref genID goes stale (patchset #4 id:60001 of https://codereview.chromium.org/825263005/)
Reason for revert:
Crazy failures.
http://build.chromium.org/p/client.skia/builders/Test-Mac10.8-MacMini4.1-GeForce320M-x86_64-Debug/builds/1428/steps/dm/logs/stdio
Original issue's description:
> notify resource caches when pixelref genID goes stale
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4675819b9dbb3ad71ec851776e5de26d342f29fe
TBR=bsalomon@google.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/936423002
Diffstat (limited to 'src/core/SkResourceCache.cpp')
-rw-r--r-- | src/core/SkResourceCache.cpp | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/src/core/SkResourceCache.cpp b/src/core/SkResourceCache.cpp index 62263605de..4ed889a0ab 100644 --- a/src/core/SkResourceCache.cpp +++ b/src/core/SkResourceCache.cpp @@ -61,8 +61,6 @@ void SkResourceCache::init() { // One of these should be explicit set by the caller after we return. fTotalByteLimit = 0; fDiscardableFactory = NULL; - - fInsidePurgeAllCounter = 0; } #include "SkDiscardableMemory.h" @@ -201,7 +199,7 @@ SkResourceCache::~SkResourceCache() { //////////////////////////////////////////////////////////////////////////////// -bool SkResourceCache::find(const Key& key, FindVisitor visitor, void* context) { +bool SkResourceCache::find(const Key& key, VisitorProc visitor, void* context) { Rec* rec = fHash->find(key); if (rec) { if (visitor(*rec, context)) { @@ -296,34 +294,6 @@ void SkResourceCache::purgeAsNeeded(bool forcePurge) { } } -void SkResourceCache::purge(const void* nameSpace, PurgeVisitor proc, void* context) { - if (this->insidePurgeAll()) { - return; - } - - // go backwards, just like purgeAsNeeded, just to make the code similar. - // could iterate either direction and still be correct. - Rec* rec = fTail; - while (rec) { - Rec* prev = rec->fPrev; - if (rec->getKey().getNamespace() == nameSpace) { - switch (proc(*rec, context)) { - case kRetainAndContinue_PurgeVisitorResult: - break; - case kPurgeAndContinue_PurgeVisitorResult: - this->remove(rec); - break; - case kRetainAndStop_PurgeVisitorResult: - return; - case kPurgeAndStop_PurgeVisitorResult: - this->remove(rec); - return; - } - } - rec = prev; - } -} - size_t SkResourceCache::setTotalByteLimit(size_t newLimit) { size_t prevLimit = fTotalByteLimit; fTotalByteLimit = newLimit; @@ -562,17 +532,12 @@ size_t SkResourceCache::GetEffectiveSingleAllocationByteLimit() { return get_cache()->getEffectiveSingleAllocationByteLimit(); } -void SkResourceCache::Purge(const void* nameSpace, PurgeVisitor proc, void* context) { - SkAutoMutexAcquire am(gMutex); - return get_cache()->purge(nameSpace, proc, context); -} - void SkResourceCache::PurgeAll() { SkAutoMutexAcquire am(gMutex); return get_cache()->purgeAll(); } -bool SkResourceCache::Find(const Key& key, FindVisitor visitor, void* context) { +bool SkResourceCache::Find(const Key& key, VisitorProc visitor, void* context) { SkAutoMutexAcquire am(gMutex); return get_cache()->find(key, visitor, context); } |