Revert of Port most uses of SkOnce to SkLazyPtr. (https://codereview.chromium.org/304383005/)
Reason for revert:
linux x86-64 release segfault in src/ports/SkFontHost_fontconfig.cpp:107
http://108.170.220.120:10117/builders/Test-Ubuntu12-ShuttleA-GTX660-x86_64-Release/builds/905/steps/RunTests/logs/stdio
Original issue's description:
> Port most uses of SkOnce to SkLazyPtr.
>
> BUG=skia:
>
> Committed: http://code.google.com/p/skia/source/detail?r=15006
>
> Committed: http://code.google.com/p/skia/source/detail?r=15014
R=reed@google.com, mtklein@chromium.org
TBR=mtklein@chromium.org, reed@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Author: mtklein@google.com
Review URL: https://codereview.chromium.org/306063004
git-svn-id: http://skia.googlecode.com/svn/trunk/include@15015 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/core/SkPathRef.h b/core/SkPathRef.h
index 47a69b7..8802714 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 SkPathRef* CreateEmptyImpl();
+ static void CreateEmptyImpl(int/*unused*/);
void setIsOval(bool isOval) { fIsOval = isOval; }
diff --git a/core/SkTypeface.h b/core/SkTypeface.h
index 0b1c1f2..0be97eb 100644
--- a/core/SkTypeface.h
+++ b/core/SkTypeface.h
@@ -339,8 +339,7 @@
uint32_t glyphIDsCount = 0) const;
private:
- static SkTypeface* CreateDefault(int style); // SkLazyPtr requires an int, not a Style.
- static void DeleteDefault(SkTypeface*);
+ static void create_default_typeface(Style style);
SkFontID fUniqueID;
Style fStyle;
diff --git a/ports/SkFontMgr.h b/ports/SkFontMgr.h
index bb8c7b7..a2fad9a 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
- static SkFontMgr* CreateDefault();
+ friend void set_up_default(SkFontMgr** singleton);
typedef SkRefCnt INHERITED;
};
diff --git a/ports/SkFontMgr_indirect.h b/ports/SkFontMgr_indirect.h
index b9ce344..6d497ee 100644
--- a/ports/SkFontMgr_indirect.h
+++ b/ports/SkFontMgr_indirect.h
@@ -11,6 +11,7 @@
#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 bd99497..68b4462 100644
--- a/ports/SkRemotableFontMgr.h
+++ b/ports/SkRemotableFontMgr.h
@@ -46,7 +46,7 @@
private:
SkRemotableFontIdentitySet() : fCount(0), fData() { }
- static SkRemotableFontIdentitySet* NewEmptyImpl();
+ static void NewEmptyImpl(int);
int fCount;
SkAutoTMalloc<SkFontIdentity> fData;