Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: src/core/SkTHash.h

Issue 948473002: Port GrGLCaps over to use SkTHash. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: winders Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/tests.gypi ('k') | src/core/SkTHashCache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkTHash.h
diff --git a/src/core/SkTHash.h b/src/core/SkTHash.h
index c7917ac668ae5219343972fad621cc59a96c0e6c..b47f8fa766009f5fd455b1a98e06317917dc2a21 100644
--- a/src/core/SkTHash.h
+++ b/src/core/SkTHash.h
@@ -18,6 +18,12 @@ class SkTHashTable : SkNoncopyable {
public:
SkTHashTable() : fCount(0), fCapacity(0) {}
+ // Clear the table.
+ void reset() {
+ this->~SkTHashTable();
+ SkNEW_PLACEMENT(this, SkTHashTable);
+ }
+
// How many entries are in the table?
int count() const { return fCount; }
@@ -144,6 +150,9 @@ class SkTHashMap : SkNoncopyable {
public:
SkTHashMap() {}
+ // Clear the map.
+ void reset() { fTable.reset(); }
+
// How many key/value pairs are in the table?
int count() const { return fTable.count(); }
@@ -187,6 +196,9 @@ class SkTHashSet : SkNoncopyable {
public:
SkTHashSet() {}
+ // Clear the set.
+ void reset() { fTable.reset(); }
+
// How many items are in the set?
int count() const { return fTable.count(); }
« no previous file with comments | « gyp/tests.gypi ('k') | src/core/SkTHashCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698