aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2016-08-05 06:51:50 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-05 06:51:50 -0700
commitfeb3c1a57faee39dc10ac904f6b215ba50e286b4 (patch)
treec861461ccc43d19a3b19fe7482c5e0381baccb5a /src/ports
parent4c35a3f905670873b3174c5e6c9279677b4f9d54 (diff)
Move to SkDataTable::MakeXXX and sk_sp.
Change SkDataTable::NewXXX to SkDataTable::MakeXXX and return sk_sp. This updates users of SkDataTable to sk_sp as well. There do not appear to be any external users of these methods. Review-Url: https://codereview.chromium.org/2211143002
Diffstat (limited to 'src/ports')
-rw-r--r--src/ports/SkFontConfigInterface_direct.cpp6
-rw-r--r--src/ports/SkFontConfigInterface_direct.h2
-rw-r--r--src/ports/SkFontMgr_FontConfigInterface.cpp2
-rw-r--r--src/ports/SkFontMgr_fontconfig.cpp8
-rw-r--r--src/ports/SkRemotableFontMgr_win_dw.cpp2
5 files changed, 10 insertions, 10 deletions
diff --git a/src/ports/SkFontConfigInterface_direct.cpp b/src/ports/SkFontConfigInterface_direct.cpp
index 3cde837b9e..3455447246 100644
--- a/src/ports/SkFontConfigInterface_direct.cpp
+++ b/src/ports/SkFontConfigInterface_direct.cpp
@@ -698,7 +698,7 @@ static bool find_name(const SkTDArray<const char*>& list, const char* str) {
return false;
}
-SkDataTable* SkFontConfigInterfaceDirect::getFamilyNames() {
+sk_sp<SkDataTable> SkFontConfigInterfaceDirect::getFamilyNames() {
FCLocker lock;
FcPattern* pat = FcPatternCreate();
@@ -730,6 +730,6 @@ SkDataTable* SkFontConfigInterfaceDirect::getFamilyNames() {
}
}
- return SkDataTable::NewCopyArrays((const void*const*)names.begin(),
- sizes.begin(), names.count());
+ return SkDataTable::MakeCopyArrays((const void*const*)names.begin(),
+ sizes.begin(), names.count());
}
diff --git a/src/ports/SkFontConfigInterface_direct.h b/src/ports/SkFontConfigInterface_direct.h
index 3ccb390a70..6cd0a8f9ba 100644
--- a/src/ports/SkFontConfigInterface_direct.h
+++ b/src/ports/SkFontConfigInterface_direct.h
@@ -25,7 +25,7 @@ public:
SkStreamAsset* openStream(const FontIdentity&) override;
// new APIs
- SkDataTable* getFamilyNames() override;
+ sk_sp<SkDataTable> getFamilyNames() override;
protected:
virtual bool isAccessible(const char* filename);
diff --git a/src/ports/SkFontMgr_FontConfigInterface.cpp b/src/ports/SkFontMgr_FontConfigInterface.cpp
index 09b4d13dd4..133b503444 100644
--- a/src/ports/SkFontMgr_FontConfigInterface.cpp
+++ b/src/ports/SkFontMgr_FontConfigInterface.cpp
@@ -139,7 +139,7 @@ static bool find_by_FontIdentity(SkTypeface* cachedTypeface, void* ctx) {
class SkFontMgr_FCI : public SkFontMgr {
SkAutoTUnref<SkFontConfigInterface> fFCI;
- SkAutoTUnref<SkDataTable> fFamilyNames;
+ sk_sp<SkDataTable> fFamilyNames;
SkTypeface_FreeType::Scanner fScanner;
mutable SkMutex fMutex;
diff --git a/src/ports/SkFontMgr_fontconfig.cpp b/src/ports/SkFontMgr_fontconfig.cpp
index 0336e5d921..fd5f1b0830 100644
--- a/src/ports/SkFontMgr_fontconfig.cpp
+++ b/src/ports/SkFontMgr_fontconfig.cpp
@@ -503,7 +503,7 @@ private:
class SkFontMgr_fontconfig : public SkFontMgr {
mutable SkAutoFcConfig fFC;
- SkAutoTUnref<SkDataTable> fFamilyNames;
+ sk_sp<SkDataTable> fFamilyNames;
SkTypeface_FreeType::Scanner fScanner;
class StyleSet : public SkFontStyleSet {
@@ -579,7 +579,7 @@ class SkFontMgr_fontconfig : public SkFontMgr {
return false;
}
- static SkDataTable* GetFamilyNames(FcConfig* fcconfig) {
+ static sk_sp<SkDataTable> GetFamilyNames(FcConfig* fcconfig) {
FCLocker lock;
SkTDArray<const char*> names;
@@ -613,8 +613,8 @@ class SkFontMgr_fontconfig : public SkFontMgr {
}
}
- return SkDataTable::NewCopyArrays((void const *const *)names.begin(),
- sizes.begin(), names.count());
+ return SkDataTable::MakeCopyArrays((void const *const *)names.begin(),
+ sizes.begin(), names.count());
}
static bool FindByFcPattern(SkTypeface* cached, void* ctx) {
diff --git a/src/ports/SkRemotableFontMgr_win_dw.cpp b/src/ports/SkRemotableFontMgr_win_dw.cpp
index ea5562cfbc..a4c895ad0d 100644
--- a/src/ports/SkRemotableFontMgr_win_dw.cpp
+++ b/src/ports/SkRemotableFontMgr_win_dw.cpp
@@ -90,7 +90,7 @@ public:
memcpy(fLocaleName.get(), localeName, localeNameLength * sizeof(WCHAR));
}
- SkDataTable* getFamilyNames() const override {
+ sk_sp<SkDataTable> getFamilyNames() const override {
int count = fFontCollection->GetFontFamilyCount();
SkDataTableBuilder names(1024);