Port most uses of SkOnce to SkLazyPtr.
BUG=skia:
R=reed@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/304383005
git-svn-id: http://skia.googlecode.com/svn/trunk/include@15006 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/core/SkPathRef.h b/core/SkPathRef.h
index 8802714..47a69b7 100644
--- a/core/SkPathRef.h
+++ b/core/SkPathRef.h
@@ -418,7 +418,7 @@
/**
* Called the first time someone calls CreateEmpty to actually create the singleton.
*/
- static void CreateEmptyImpl(int/*unused*/);
+ static SkPathRef* CreateEmptyImpl();
void setIsOval(bool isOval) { fIsOval = isOval; }
diff --git a/core/SkTypeface.h b/core/SkTypeface.h
index 0be97eb..0b1c1f2 100644
--- a/core/SkTypeface.h
+++ b/core/SkTypeface.h
@@ -339,7 +339,8 @@
uint32_t glyphIDsCount = 0) const;
private:
- static void create_default_typeface(Style style);
+ static SkTypeface* CreateDefault(int style); // SkLazyPtr requires an int, not a Style.
+ static void DeleteDefault(SkTypeface*);
SkFontID fUniqueID;
Style fStyle;
diff --git a/ports/SkFontMgr.h b/ports/SkFontMgr.h
index a2fad9a..bb8c7b7 100644
--- a/ports/SkFontMgr.h
+++ b/ports/SkFontMgr.h
@@ -131,7 +131,7 @@
unsigned styleBits) const = 0;
private:
static SkFontMgr* Factory(); // implemented by porting layer
- friend void set_up_default(SkFontMgr** singleton);
+ static SkFontMgr* CreateDefault();
typedef SkRefCnt INHERITED;
};
diff --git a/ports/SkFontMgr_indirect.h b/ports/SkFontMgr_indirect.h
index 6d497ee..b9ce344 100644
--- a/ports/SkFontMgr_indirect.h
+++ b/ports/SkFontMgr_indirect.h
@@ -11,7 +11,6 @@
#include "SkDataTable.h"
#include "SkFontMgr.h"
#include "SkFontStyle.h"
-#include "SkOnce.h"
#include "SkRemotableFontMgr.h"
#include "SkTArray.h"
#include "SkTypeface.h"
diff --git a/ports/SkRemotableFontMgr.h b/ports/SkRemotableFontMgr.h
index 68b4462..bd99497 100644
--- a/ports/SkRemotableFontMgr.h
+++ b/ports/SkRemotableFontMgr.h
@@ -46,7 +46,7 @@
private:
SkRemotableFontIdentitySet() : fCount(0), fData() { }
- static void NewEmptyImpl(int);
+ static SkRemotableFontIdentitySet* NewEmptyImpl();
int fCount;
SkAutoTMalloc<SkFontIdentity> fData;