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

Unified Diff: include/gpu/GrResourceKey.h

Issue 1894893002: Modernize and trim down SkOnce. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: might as well class Created 4 years, 8 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
Index: include/gpu/GrResourceKey.h
diff --git a/include/gpu/GrResourceKey.h b/include/gpu/GrResourceKey.h
index ff83a43104489c3c39878afa63502b4bfde3bcc9..9f8063d955d9945b2dfc88c01bbed127f6b770da 100644
--- a/include/gpu/GrResourceKey.h
+++ b/include/gpu/GrResourceKey.h
@@ -71,7 +71,7 @@ protected:
/** size of the key data, excluding meta-data (hash, domain, etc). */
size_t dataSize() const { return this->size() - 4 * kMetaDataCnt; }
-
+
/** ptr to the key data, excluding meta-data (hash, domain, etc). */
const uint32_t* data() const {
this->validate();
@@ -290,12 +290,12 @@ private:
*/
/** Place outside of function/class definitions. */
-#define GR_DECLARE_STATIC_UNIQUE_KEY(name) SK_DECLARE_STATIC_ONCE(name##_once)
+#define GR_DECLARE_STATIC_UNIQUE_KEY(name) static SkOnce name##_once
/** Place inside function where the key is used. */
#define GR_DEFINE_STATIC_UNIQUE_KEY(name) \
static SkAlignedSTStorage<1, GrUniqueKey> name##_storage; \
- SkOnce(&name##_once, gr_init_static_unique_key_once, &name##_storage); \
+ name##_once(gr_init_static_unique_key_once, &name##_storage); \
static const GrUniqueKey& name = *reinterpret_cast<GrUniqueKey*>(name##_storage.get());
static inline void gr_init_static_unique_key_once(SkAlignedSTStorage<1,GrUniqueKey>* keyStorage) {

Powered by Google App Engine
This is Rietveld 408576698