diff options
author | Greg Daniel <egdaniel@google.com> | 2017-11-08 19:58:51 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-11-08 19:58:58 +0000 |
commit | 065b41dd90782e22b5708c8b43696db641d54f46 (patch) | |
tree | 218278f670fb63274f6fbbcf68a6f99ad431029b /src/core/SkTMultiMap.h | |
parent | 0078ab22519313be727ace05306333910768f58e (diff) |
Revert "Prepare to enable explicit gpu resource allocation"
This reverts commit f290376736b42a19b87da78c6ba2558313896860.
Reason for revert: Changed generated effect instead of FP
Original change's description:
> Prepare to enable explicit gpu resource allocation
>
> Change-Id: I407e45711c61831febbac3d3d3a88e3fdde92c5f
> Reviewed-on: https://skia-review.googlesource.com/68212
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,robertphillips@google.com
Change-Id: I949500d94c7461b7cf38d615117cfcdc9a791780
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/68900
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/core/SkTMultiMap.h')
-rw-r--r-- | src/core/SkTMultiMap.h | 51 |
1 files changed, 14 insertions, 37 deletions
diff --git a/src/core/SkTMultiMap.h b/src/core/SkTMultiMap.h index 987a306661..3d6e38e454 100644 --- a/src/core/SkTMultiMap.h +++ b/src/core/SkTMultiMap.h @@ -34,7 +34,6 @@ public: for ( ; !iter.done(); ++iter) { ValueList* next; for (ValueList* cur = &(*iter); cur; cur = next) { - HashTraits::OnFree(cur->fValue); next = cur->fNext; delete cur; } @@ -70,7 +69,20 @@ public: list = list->fNext; } - this->internalRemove(prev, list, key); + if (list->fNext) { + ValueList* next = list->fNext; + list->fValue = next->fValue; + list->fNext = next->fNext; + delete next; + } else if (prev) { + prev->fNext = nullptr; + delete list; + } else { + fHash.remove(key); + delete list; + } + + --fCount; } T* find(const Key& key) const { @@ -93,23 +105,6 @@ public: return nullptr; } - template<class FindPredicate> - T* findAndRemove(const Key& key, const FindPredicate f) { - ValueList* list = fHash.find(key); - - ValueList* prev = nullptr; - while (list) { - if (f(list->fValue)){ - T* value = list->fValue; - this->internalRemove(prev, list, key); - return value; - } - prev = list; - list = list->fNext; - } - return nullptr; - } - int count() const { return fCount; } #ifdef SK_DEBUG @@ -173,24 +168,6 @@ public: private: SkTDynamicHash<ValueList, Key> fHash; int fCount; - - void internalRemove(ValueList* prev, ValueList* elem, const Key& key) { - if (elem->fNext) { - ValueList* next = elem->fNext; - elem->fValue = next->fValue; - elem->fNext = next->fNext; - delete next; - } else if (prev) { - prev->fNext = nullptr; - delete elem; - } else { - fHash.remove(key); - delete elem; - } - - --fCount; - } - }; #endif |