aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports/SkFontConfigInterface_direct.cpp
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2017-01-20 16:07:52 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-23 17:09:37 +0000
commit9adfef8680c22ce8980031b4bcb9f1fadd066a80 (patch)
tree39cbe845eebfe3e1ce063910207b03d63443a29e /src/ports/SkFontConfigInterface_direct.cpp
parent5b92e4ab8e1d238f3acbd775accae8c5436c1b71 (diff)
Remove public APIs that use SkDataTable.
Change-Id: Ibb8f987efc585713a6f8061c72fb416d07be13b1 Reviewed-on: https://skia-review.googlesource.com/7352 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'src/ports/SkFontConfigInterface_direct.cpp')
-rw-r--r--src/ports/SkFontConfigInterface_direct.cpp49
1 files changed, 0 insertions, 49 deletions
diff --git a/src/ports/SkFontConfigInterface_direct.cpp b/src/ports/SkFontConfigInterface_direct.cpp
index c1a73e626c..d552befb5a 100644
--- a/src/ports/SkFontConfigInterface_direct.cpp
+++ b/src/ports/SkFontConfigInterface_direct.cpp
@@ -9,7 +9,6 @@
#include "SkAutoMalloc.h"
#include "SkBuffer.h"
-#include "SkDataTable.h"
#include "SkFixed.h"
#include "SkFontConfigInterface_direct.h"
#include "SkFontStyle.h"
@@ -685,51 +684,3 @@ bool SkFontConfigInterfaceDirect::matchFamilyName(const char familyName[],
SkStreamAsset* SkFontConfigInterfaceDirect::openStream(const FontIdentity& identity) {
return SkStream::MakeFromFile(identity.fString.c_str()).release();
}
-
-///////////////////////////////////////////////////////////////////////////////
-
-static bool find_name(const SkTDArray<const char*>& list, const char* str) {
- int count = list.count();
- for (int i = 0; i < count; ++i) {
- if (!strcmp(list[i], str)) {
- return true;
- }
- }
- return false;
-}
-
-sk_sp<SkDataTable> SkFontConfigInterfaceDirect::getFamilyNames() {
- FCLocker lock;
-
- FcPattern* pat = FcPatternCreate();
- SkAutoTCallVProc<FcPattern, FcPatternDestroy> autoDestroyPat(pat);
- if (nullptr == pat) {
- return nullptr;
- }
-
- FcObjectSet* os = FcObjectSetBuild(FC_FAMILY, (char *)0);
- SkAutoTCallVProc<FcObjectSet, FcObjectSetDestroy> autoDestroyOs(os);
- if (nullptr == os) {
- return nullptr;
- }
-
- FcFontSet* fs = FcFontList(nullptr, pat, os);
- SkAutoTCallVProc<FcFontSet, FcFontSetDestroy> autoDestroyFs(fs);
- if (nullptr == fs) {
- return nullptr;
- }
-
- SkTDArray<const char*> names;
- SkTDArray<size_t> sizes;
- for (int i = 0; i < fs->nfont; ++i) {
- FcPattern* match = fs->fonts[i];
- const char* famName = get_string(match, FC_FAMILY);
- if (famName && !find_name(names, famName)) {
- *names.append() = famName;
- *sizes.append() = strlen(famName) + 1;
- }
- }
-
- return SkDataTable::MakeCopyArrays((const void*const*)names.begin(),
- sizes.begin(), names.count());
-}