Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(390)

Unified Diff: src/ports/SkFontHost_mac.cpp

Issue 1949313003: Reland of SkOncePtr -> SkOnce (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/opts/opts_check_x86.cpp ('k') | src/utils/SkEventTracer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_mac.cpp
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index 72d4690870f4d54139b397055df95feb4f0a57d2..8593b396117ced96e3a4414b2d069fe03e849ecb 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 "SkOncePtr.h"
+#include "SkOnce.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) {
- auto ctFontDrawGlyphs = gCTFontDrawGlyphs.get(choose_CTFontDrawGlyphs);
+ static SkOnce once;
+ static CTFontDrawGlyphsProc* ctFontDrawGlyphs;
+ once([]{ ctFontDrawGlyphs = choose_CTFontDrawGlyphs(); });
if (!fRGBSpace) {
//It doesn't appear to matter what color space is specified.
« no previous file with comments | « src/opts/opts_check_x86.cpp ('k') | src/utils/SkEventTracer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698