Index: src/ports/SkFontHost_mac.cpp |
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp |
index 8593b396117ced96e3a4414b2d069fe03e849ecb..72d4690870f4d54139b397055df95feb4f0a57d2 100644 |
--- a/src/ports/SkFontHost_mac.cpp |
+++ b/src/ports/SkFontHost_mac.cpp |
@@ -35,7 +35,7 @@ |
#include "SkOTTable_hhea.h" |
#include "SkOTTable_loca.h" |
#include "SkOTUtils.h" |
-#include "SkOnce.h" |
+#include "SkOncePtr.h" |
#include "SkPaint.h" |
#include "SkPath.h" |
#include "SkSFNTHeader.h" |
@@ -778,12 +778,12 @@ |
return &legacy_CTFontDrawGlyphs; |
} |
+SK_DECLARE_STATIC_ONCE_PTR(CTFontDrawGlyphsProc, gCTFontDrawGlyphs); |
+ |
CGRGBPixel* Offscreen::getCG(const SkScalerContext_Mac& context, const SkGlyph& glyph, |
CGGlyph glyphID, size_t* rowBytesPtr, |
bool generateA8FromLCD) { |
- static SkOnce once; |
- static CTFontDrawGlyphsProc* ctFontDrawGlyphs; |
- once([]{ ctFontDrawGlyphs = choose_CTFontDrawGlyphs(); }); |
+ auto ctFontDrawGlyphs = gCTFontDrawGlyphs.get(choose_CTFontDrawGlyphs); |
if (!fRGBSpace) { |
//It doesn't appear to matter what color space is specified. |