| Index: src/core/SkFontMgr.cpp
|
| diff --git a/src/core/SkFontMgr.cpp b/src/core/SkFontMgr.cpp
|
| index ebb9a8966207814024d2d6b5b66095c64882bf2e..0f0066792636837af660e610ab96ede11b5d7bb2 100644
|
| --- a/src/core/SkFontMgr.cpp
|
| +++ b/src/core/SkFontMgr.cpp
|
| @@ -7,7 +7,7 @@
|
|
|
| #include "SkFontDescriptor.h"
|
| #include "SkFontMgr.h"
|
| -#include "SkOncePtr.h"
|
| +#include "SkOnce.h"
|
| #include "SkStream.h"
|
| #include "SkTypes.h"
|
|
|
| @@ -169,12 +169,15 @@
|
| return this->onLegacyCreateTypeface(familyName, style);
|
| }
|
|
|
| -SK_DECLARE_STATIC_ONCE_PTR(SkFontMgr, singleton);
|
| SkFontMgr* SkFontMgr::RefDefault() {
|
| - return SkRef(singleton.get([]{
|
| + static SkOnce once;
|
| + static SkFontMgr* singleton;
|
| +
|
| + once([]{
|
| SkFontMgr* fm = SkFontMgr::Factory();
|
| - return fm ? fm : new SkEmptyFontMgr;
|
| - }));
|
| + singleton = fm ? fm : new SkEmptyFontMgr;
|
| + });
|
| + return SkRef(singleton);
|
| }
|
|
|
| /**
|
|
|