diff options
author | 2014-10-13 13:17:56 -0700 | |
---|---|---|
committer | 2014-10-13 13:17:56 -0700 | |
commit | 148ec59001ca7d7e54aec580a048c6dd2a085991 (patch) | |
tree | ee310a6be5a0b53ac4ed05dd6907bd0d328dda6d /include | |
parent | 70242ace3b2ed06b33ee5ea5c9ac3aedea89b194 (diff) |
Require SK_DECLARE_STATIC_LAZY_PTR is used in global scope.
Function- or method- local scope isn't threadsafe; the pointer is generally
zero-initialized on first use in function scope (i.e. lazily... we have to go
deeper), but for globals we can be pretty sure the linker will do that for us.
BUG=skia:
No public API changes.
TBR=reed@google.com
Review URL: https://codereview.chromium.org/651723003
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkData.h | 3 | ||||
-rw-r--r-- | include/core/SkPathRef.h | 2 | ||||
-rw-r--r-- | include/ports/SkFontMgr.h | 2 | ||||
-rw-r--r-- | include/ports/SkRemotableFontMgr.h | 3 |
4 files changed, 5 insertions, 5 deletions
diff --git a/include/core/SkData.h b/include/core/SkData.h index e25ef50d71..4f0c213da9 100644 --- a/include/core/SkData.h +++ b/include/core/SkData.h @@ -171,8 +171,7 @@ private: virtual void internal_dispose() const SK_OVERRIDE; // Called the first time someone calls NewEmpty to initialize the singleton. - static SkData* NewEmptyImpl(); - static void DeleteEmpty(SkData*); + friend SkData* sk_new_empty_data(); // shared internal factory static SkData* PrivateNewWithCopy(const void* srcOrNull, size_t length); diff --git a/include/core/SkPathRef.h b/include/core/SkPathRef.h index 0b661b44cb..4b57fc80e4 100644 --- a/include/core/SkPathRef.h +++ b/include/core/SkPathRef.h @@ -421,7 +421,7 @@ private: /** * Called the first time someone calls CreateEmpty to actually create the singleton. */ - static SkPathRef* CreateEmptyImpl(); + friend SkPathRef* sk_create_empty_pathref(); void setIsOval(bool isOval) { fIsOval = isOval; } diff --git a/include/ports/SkFontMgr.h b/include/ports/SkFontMgr.h index bb8c7b7d98..181fe9f6aa 100644 --- a/include/ports/SkFontMgr.h +++ b/include/ports/SkFontMgr.h @@ -131,7 +131,7 @@ protected: unsigned styleBits) const = 0; private: static SkFontMgr* Factory(); // implemented by porting layer - static SkFontMgr* CreateDefault(); + friend SkFontMgr* sk_fontmgr_create_default(); typedef SkRefCnt INHERITED; }; diff --git a/include/ports/SkRemotableFontMgr.h b/include/ports/SkRemotableFontMgr.h index bd99497cda..bf2459955f 100644 --- a/include/ports/SkRemotableFontMgr.h +++ b/include/ports/SkRemotableFontMgr.h @@ -46,7 +46,8 @@ public: private: SkRemotableFontIdentitySet() : fCount(0), fData() { } - static SkRemotableFontIdentitySet* NewEmptyImpl(); + + friend SkRemotableFontIdentitySet* sk_remotable_font_identity_set_new(); int fCount; SkAutoTMalloc<SkFontIdentity> fData; |