aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkTMultiMap.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2014-11-10 10:19:06 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-10 10:19:06 -0800
commit8b79d23f825cd9e0f9e3bf8aaa9e209940b17ef6 (patch)
treec67085dee293d8f43cb1c8fdd73f2aaaa769fece /src/core/SkTMultiMap.h
parent8e74b1565c5573a0be40060cebbc112fc156f26d (diff)
Use GrResourceCache2 to service content key lookups
Diffstat (limited to 'src/core/SkTMultiMap.h')
-rw-r--r--src/core/SkTMultiMap.h13
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;