Index: src/core/SkImageFilter.cpp |
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp |
index 9bf9b28ab6cd9ca4a1be35add5113797f19bf9df..a3f89d08fad3fc4023c4ddc9805764a34972372e 100644 |
--- a/src/core/SkImageFilter.cpp |
+++ b/src/core/SkImageFilter.cpp |
@@ -18,7 +18,6 @@ |
#include "SkReadBuffer.h" |
#include "SkRect.h" |
#include "SkTDynamicHash.h" |
-#include "SkTHash.h" |
#include "SkTInternalLList.h" |
#include "SkValidationUtils.h" |
#include "SkWriteBuffer.h" |
@@ -202,7 +201,6 @@ |
SkSafeUnref(fInputs[i]); |
} |
delete[] fInputs; |
- Cache::Get()->purgeByImageFilterId(fUniqueID); |
} |
SkImageFilter::SkImageFilter(int inputCount, SkReadBuffer& buffer) |
@@ -602,13 +600,6 @@ |
removeInternal(v); |
} |
Value* v = new Value(key, result, offset); |
- if (SkTArray<Key>** array = fIdToKeys.find(key.fUniqueID)) { |
- (*array)->push_back(key); |
- } else { |
- SkTArray<Key>* keyArray = new SkTArray<Key>(); |
- keyArray->push_back(key); |
- fIdToKeys.set(key.fUniqueID, keyArray); |
- } |
fLookup.add(v); |
fLRU.addToHead(v); |
fCurrentBytes += result.getSize(); |
@@ -631,19 +622,6 @@ |
} |
} |
- void purgeByImageFilterId(uint32_t uniqueID) override { |
- SkAutoMutexAcquire mutex(fMutex); |
- if (SkTArray<Key>** array = fIdToKeys.find(uniqueID)) { |
- for (auto& key : **array) { |
- if (Value* v = fLookup.find(key)) { |
- this->removeInternal(v); |
- } |
- } |
- fIdToKeys.remove(uniqueID); |
- delete *array; // This can be deleted outside the lock |
- } |
- } |
- |
private: |
void removeInternal(Value* v) { |
fCurrentBytes -= v->fBitmap.getSize(); |
@@ -652,12 +630,11 @@ |
delete v; |
} |
private: |
- SkTDynamicHash<Value, Key> fLookup; |
- SkTHashMap<uint32_t, SkTArray<Key>*> fIdToKeys; |
- mutable SkTInternalLList<Value> fLRU; |
- size_t fMaxBytes; |
- size_t fCurrentBytes; |
- mutable SkMutex fMutex; |
+ SkTDynamicHash<Value, Key> fLookup; |
+ mutable SkTInternalLList<Value> fLRU; |
+ size_t fMaxBytes; |
+ size_t fCurrentBytes; |
+ mutable SkMutex fMutex; |
}; |
} // namespace |