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

Unified Diff: src/ports/SkFontConfigInterface_android.cpp

Issue 393913002: Remove SkRefPtr. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix parameter. Created 6 years, 5 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 | « include/core/SkRefCnt.h ('k') | tests/UtilsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontConfigInterface_android.cpp
diff --git a/src/ports/SkFontConfigInterface_android.cpp b/src/ports/SkFontConfigInterface_android.cpp
index 236f62b808275ced3e71a52dacffe5b7cb3d256a..c4f1753eb777f22c8d88e1c9a2f64dccce779137 100644
--- a/src/ports/SkFontConfigInterface_android.cpp
+++ b/src/ports/SkFontConfigInterface_android.cpp
@@ -53,7 +53,7 @@ typedef int32_t FamilyRecID;
// used to record our notion of the pre-existing fonts
struct FontRec {
- SkRefPtr<SkTypeface> fTypeface;
+ SkAutoTUnref<SkTypeface> fTypeface;
SkString fFileName;
SkTypeface::Style fStyle;
bool fIsValid;
@@ -115,8 +115,8 @@ private:
FallbackFontList* getCurrentLocaleFallbackFontList();
FallbackFontList* findFallbackFontList(const SkLanguage& lang, bool isOriginal = true);
- SkTArray<FontRec> fFonts;
- SkTArray<FamilyRec> fFontFamilies;
+ SkTArray<FontRec, true> fFonts;
+ SkTArray<FamilyRec, true> fFontFamilies;
SkTDict<FamilyRecID> fFamilyNameDict;
FamilyRecID fDefaultFamilyRecID;
@@ -163,7 +163,7 @@ SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface(SkBase
///////////////////////////////////////////////////////////////////////////////
-static bool has_font(const SkTArray<FontRec>& array, const SkString& filename) {
+static bool has_font(const SkTArray<FontRec, true>& array, const SkString& filename) {
for (int i = 0; i < array.count(); i++) {
if (array[i].fFileName == filename) {
return true;
@@ -503,7 +503,7 @@ SkTypeface* SkFontConfigInterfaceAndroid::getTypefaceForFontRec(FontRecID fontRe
}
// store the result for subsequent lookups
- fontRec.fTypeface = face;
+ fontRec.fTypeface.reset(face);
}
SkASSERT(face);
return face;
« no previous file with comments | « include/core/SkRefCnt.h ('k') | tests/UtilsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698