aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-02-12 13:20:08 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-12 13:20:08 -0800
commit979e0eacbd59327654d0c8d4216d6732413ef2a0 (patch)
tree7a2b531b512870ab097c23df7d32548f07c71f84 /include
parentcd963666006f7171e1dc2156ecf5016d53a7af5b (diff)
Spin off SkTHashTable, SkTHashMap, SkTHashSet
SkTHashTable is very similar to SkTDynamicHash, except it's generalized to support non-pointer value types. It doesn't support remove(), just to keep things simple (it's not hard to add). Instead of an iterator, it has foreach(), again, to keep things simple. SkTHashMap<K,V> and SkTHashSet<T> build a friendlier experience on top of SkTHashTable. BUG=skia: Review URL: https://codereview.chromium.org/925613002
Diffstat (limited to 'include')
-rw-r--r--include/core/SkTemplates.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/core/SkTemplates.h b/include/core/SkTemplates.h
index c26e4422b5..b18556b452 100644
--- a/include/core/SkTemplates.h
+++ b/include/core/SkTemplates.h
@@ -254,6 +254,11 @@ public:
return fArray[index];
}
+ void swap(SkAutoTArray& other) {
+ SkTSwap(fArray, other.fArray);
+ SkDEBUGCODE(SkTSwap(fCount, other.fCount));
+ }
+
private:
T* fArray;
SkDEBUGCODE(int fCount;)