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

Unified Diff: src/ports/SkFontMgr_FontConfigInterface.cpp

Issue 2346333002: Split SkFontConfigInterface globals and factory. (Closed)
Patch Set: Created 4 years, 3 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
Index: src/ports/SkFontMgr_FontConfigInterface.cpp
diff --git a/src/ports/SkFontMgr_FontConfigInterface.cpp b/src/ports/SkFontMgr_FontConfigInterface.cpp
index a6a055a9d2f24f4aa7723a2797fae5df460e8661..d4c7569009e4ccebf416358879da011f0993dba5 100644
--- a/src/ports/SkFontMgr_FontConfigInterface.cpp
+++ b/src/ports/SkFontMgr_FontConfigInterface.cpp
@@ -9,6 +9,7 @@
#include "SkFontConfigTypeface.h"
#include "SkFontDescriptor.h"
#include "SkFontMgr.h"
+#include "SkFontMgr_FontConfigInterface.h"
#include "SkFontStyle.h"
#include "SkMakeUnique.h"
#include "SkMutex.h"
@@ -152,7 +153,7 @@ static bool find_by_FontIdentity(SkTypeface* cachedTypeface, void* ctx) {
///////////////////////////////////////////////////////////////////////////////
class SkFontMgr_FCI : public SkFontMgr {
- SkAutoTUnref<SkFontConfigInterface> fFCI;
+ sk_sp<SkFontConfigInterface> fFCI;
sk_sp<SkDataTable> fFamilyNames;
SkTypeface_FreeType::Scanner fScanner;
@@ -165,8 +166,8 @@ class SkFontMgr_FCI : public SkFontMgr {
mutable SkFontRequestCache fCache;
public:
- SkFontMgr_FCI(SkFontConfigInterface* fci)
- : fFCI(fci)
+ SkFontMgr_FCI(sk_sp<SkFontConfigInterface> fci)
+ : fFCI(std::move(fci))
, fFamilyNames(fFCI->getFamilyNames())
, fCache(kMaxSize)
{}
@@ -295,7 +296,7 @@ protected:
}
};
-SK_API SkFontMgr* SkFontMgr_New_FCI(SkFontConfigInterface* fci) {
+SK_API SkFontMgr* SkFontMgr_New_FCI(sk_sp<SkFontConfigInterface> fci) {
SkASSERT(fci);
- return new SkFontMgr_FCI(fci);
+ return new SkFontMgr_FCI(std::move(fci));
}

Powered by Google App Engine
This is Rietveld 408576698