diff options
author | bsalomon <bsalomon@google.com> | 2014-11-10 10:19:06 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-10 10:19:06 -0800 |
commit | 8b79d23f825cd9e0f9e3bf8aaa9e209940b17ef6 (patch) | |
tree | c67085dee293d8f43cb1c8fdd73f2aaaa769fece /src/core/SkTMultiMap.h | |
parent | 8e74b1565c5573a0be40060cebbc112fc156f26d (diff) |
Use GrResourceCache2 to service content key lookups
BUG=skia:2889
Review URL: https://codereview.chromium.org/707493002
Diffstat (limited to 'src/core/SkTMultiMap.h')
-rw-r--r-- | src/core/SkTMultiMap.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/SkTMultiMap.h b/src/core/SkTMultiMap.h index 70076f0cad..1168ed6e91 100644 --- a/src/core/SkTMultiMap.h +++ b/src/core/SkTMultiMap.h @@ -102,6 +102,19 @@ public: int count() const { return fCount; } +#ifdef SK_DEBUG + // This is not particularly fast and only used for validation, so debug only. + int countForKey(const Key& key) const { + int count = 0; + ValueList* list = fHash.find(key); + while (list) { + list = list->fNext; + ++count; + } + return count; + } +#endif + private: SkTDynamicHash<ValueList, Key> fHash; int fCount; |