aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports/SkFontHost_android.cpp
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-22 17:21:59 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-22 17:21:59 +0000
commit292b1d4903a770a77282508054917b48fb989d49 (patch)
tree38a7beeb3d682f047cda1b798f76e52eb9c7e6f0 /src/ports/SkFontHost_android.cpp
parentcb693198e7e1d2f8318b2455c52210e6e1ea13e3 (diff)
remove SkFontHost::OpenStream(), now subsumed by SkTypeface::openStream()
remove obsolete/abandoned SkFontHost_freetype_mac.cpp Review URL: https://codereview.chromium.org/13008019 git-svn-id: http://skia.googlecode.com/svn/trunk@8342 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/ports/SkFontHost_android.cpp')
-rw-r--r--src/ports/SkFontHost_android.cpp36
1 files changed, 13 insertions, 23 deletions
diff --git a/src/ports/SkFontHost_android.cpp b/src/ports/SkFontHost_android.cpp
index 5d3b583892..ad10a0fd34 100644
--- a/src/ports/SkFontHost_android.cpp
+++ b/src/ports/SkFontHost_android.cpp
@@ -313,7 +313,6 @@ public:
bool isSysFont() const { return fIsSysFont; }
- virtual SkStream* openStream() = 0;
virtual const char* getUniqueString() const = 0;
virtual const char* getFilePath() const = 0;
@@ -338,8 +337,12 @@ public:
fStream->unref();
}
- // overrides
- virtual SkStream* openStream() {
+ virtual const char* getUniqueString() SK_OVERRIDE const { return NULL; }
+ virtual const char* getFilePath() SK_OVERRIDE const { return NULL; }
+
+protected:
+ virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE {
+ *ttcIndex = 0;
// we just ref our existing stream, since the caller will call unref()
// when they are through
fStream->ref();
@@ -347,8 +350,6 @@ public:
fStream->rewind();
return fStream;
}
- virtual const char* getUniqueString() const { return NULL; }
- virtual const char* getFilePath() const { return NULL; }
private:
SkStream* fStream;
@@ -370,10 +371,6 @@ public:
fPath.set(path);
}
- virtual SkStream* openStream() SK_OVERRIDE {
- return SkStream::NewFromFile(fPath.c_str());
- }
-
virtual const char* getUniqueString() const SK_OVERRIDE {
const char* str = strrchr(fPath.c_str(), '/');
if (str) {
@@ -386,6 +383,12 @@ public:
return fPath.c_str();
}
+protected:
+ virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE {
+ *ttcIndex = 0;
+ return SkStream::NewFromFile(fPath.c_str());
+ }
+
private:
SkString fPath;
@@ -749,7 +752,7 @@ void SkFontHost::Serialize(const SkTypeface* face, SkWStream* stream) {
const bool isCustomFont = !((FamilyTypeface*)face)->isSysFont();
if (isCustomFont) {
// store the entire font in the fontData
- SkStream* fontStream = ((FamilyTypeface*)face)->openStream();
+ SkStream* fontStream = face->openStream(NULL);
const uint32_t length = fontStream->getLength();
stream->writePackedUInt(length);
@@ -833,19 +836,6 @@ SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
return tf;
}
-SkStream* SkFontHost::OpenStream(uint32_t fontID) {
- SkAutoMutexAcquire ac(gFamilyHeadAndNameListMutex);
-
- FamilyTypeface* tf = (FamilyTypeface*)find_from_uniqueID(fontID);
- SkStream* stream = tf ? tf->openStream() : NULL;
-
- if (stream && stream->getLength() == 0) {
- stream->unref();
- stream = NULL;
- }
- return stream;
-}
-
SkTypeface* SkFontHost::NextLogicalTypeface(SkFontID currFontID, SkFontID origFontID) {
#if defined(SK_BUILD_FOR_ANDROID) && !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK)
// Skia does not support font fallback for ndk applications in order to