From ddd0ed560721bc082b38eed7c11ea792ae0713ca Mon Sep 17 00:00:00 2001 From: "bungeman@google.com" Date: Fri, 24 Feb 2012 19:56:33 +0000 Subject: Remove SkFontHost::ValidFontID PART 2: remove definition and skia callers not that Chrome's font host has been updated. See also https://chromiumcodereview.appspot.com/9347043/ http://codereview.appspot.com/5654055/ git-svn-id: http://skia.googlecode.com/svn/trunk@3255 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkFontHost.h | 6 ------ src/ports/SkFontHost_FONTPATH.cpp | 4 ---- src/ports/SkFontHost_android.cpp | 6 ------ src/ports/SkFontHost_fontconfig.cpp | 6 ------ src/ports/SkFontHost_freetype_mac.cpp | 4 ---- src/ports/SkFontHost_linux.cpp | 6 ------ src/ports/SkFontHost_mac_coretext.cpp | 4 ---- src/ports/SkFontHost_none.cpp | 5 ----- src/ports/SkFontHost_simple.cpp | 6 ------ src/utils/ios/SkFontHost_iOS.mm | 4 ---- 10 files changed, 51 deletions(-) diff --git a/include/core/SkFontHost.h b/include/core/SkFontHost.h index c549519acf..25c9ecba51 100644 --- a/include/core/SkFontHost.h +++ b/include/core/SkFontHost.h @@ -84,12 +84,6 @@ public: /////////////////////////////////////////////////////////////////////////// - /** Returns true if the specified unique ID matches an existing font. - Returning false is similar to calling OpenStream with an invalid ID, - which will return NULL in that case. - */ - static bool ValidFontID(SkFontID uniqueID); - /** Return a new stream to read the font data, or null if the uniqueID does not match an existing typeface. .The caller must call stream->unref() when it is finished reading the data. diff --git a/src/ports/SkFontHost_FONTPATH.cpp b/src/ports/SkFontHost_FONTPATH.cpp index f0438f429c..bd8f102454 100644 --- a/src/ports/SkFontHost_FONTPATH.cpp +++ b/src/ports/SkFontHost_FONTPATH.cpp @@ -279,10 +279,6 @@ SkTypeface* SkFontHost::CreateTypefaceFromFile(const char path[]) { return NULL; } -bool SkFontHost::ValidFontID(uint32_t fontID) { - return get_id(*get_default_face()) == fontID; -} - SkStream* SkFontHost::OpenStream(uint32_t fontID) { sk_throw(); // not implemented return NULL; diff --git a/src/ports/SkFontHost_android.cpp b/src/ports/SkFontHost_android.cpp index 3b1a497f24..1856cff663 100644 --- a/src/ports/SkFontHost_android.cpp +++ b/src/ports/SkFontHost_android.cpp @@ -688,12 +688,6 @@ SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace, return tf; } -bool SkFontHost::ValidFontID(uint32_t fontID) { - SkAutoMutexAcquire ac(gFamilyHeadAndNameListMutex); - - return find_from_uniqueID(fontID) != NULL; -} - SkStream* SkFontHost::OpenStream(uint32_t fontID) { SkAutoMutexAcquire ac(gFamilyHeadAndNameListMutex); diff --git a/src/ports/SkFontHost_fontconfig.cpp b/src/ports/SkFontHost_fontconfig.cpp index 454ded3d20..775a7c7b10 100644 --- a/src/ports/SkFontHost_fontconfig.cpp +++ b/src/ports/SkFontHost_fontconfig.cpp @@ -303,12 +303,6 @@ SkTypeface* SkFontHost::CreateTypefaceFromFile(const char path[]) return NULL; } -// static -bool SkFontHost::ValidFontID(SkFontID uniqueID) { - SkAutoMutexAcquire ac(global_fc_map_lock); - return global_fc_typefaces.find(uniqueID) != global_fc_typefaces.end(); -} - // static SkStream* SkFontHost::OpenStream(uint32_t id) { diff --git a/src/ports/SkFontHost_freetype_mac.cpp b/src/ports/SkFontHost_freetype_mac.cpp index 140098d178..e51f802e91 100644 --- a/src/ports/SkFontHost_freetype_mac.cpp +++ b/src/ports/SkFontHost_freetype_mac.cpp @@ -65,10 +65,6 @@ SkTypeface* SkFontHost::CreateTypefaceFromFile(const char path[]) { return create_from_path(path); } -bool SkFontHost::ValidFontID(SkFontID fontID) { - return SkTypefaceCache::FindByID(fontID) != NULL; -} - SkStream* SkFontHost::OpenStream(uint32_t fontID) { FTMacTypeface* tf = (FTMacTypeface*)SkTypefaceCache::FindByID(fontID); if (tf) { diff --git a/src/ports/SkFontHost_linux.cpp b/src/ports/SkFontHost_linux.cpp index 9195224119..be99576dcc 100644 --- a/src/ports/SkFontHost_linux.cpp +++ b/src/ports/SkFontHost_linux.cpp @@ -543,12 +543,6 @@ SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace, return tf; } -bool SkFontHost::ValidFontID(uint32_t fontID) { - SkAutoMutexAcquire ac(gFamilyMutex); - - return valid_uniqueID(fontID); -} - SkStream* SkFontHost::OpenStream(uint32_t fontID) { FamilyTypeface* tf = (FamilyTypeface*)find_from_uniqueID(fontID); SkStream* stream = tf ? tf->openStream() : NULL; diff --git a/src/ports/SkFontHost_mac_coretext.cpp b/src/ports/SkFontHost_mac_coretext.cpp index cd2dbf6c18..d39db2a273 100644 --- a/src/ports/SkFontHost_mac_coretext.cpp +++ b/src/ports/SkFontHost_mac_coretext.cpp @@ -1711,10 +1711,6 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics( /////////////////////////////////////////////////////////////////////////////// -bool SkFontHost::ValidFontID(SkFontID fontID) { - return SkTypefaceCache::FindByID(fontID) != NULL; -} - struct FontHeader { SkFixed fVersion; uint16_t fNumTables; diff --git a/src/ports/SkFontHost_none.cpp b/src/ports/SkFontHost_none.cpp index 99df2134cd..e79926d54a 100644 --- a/src/ports/SkFontHost_none.cpp +++ b/src/ports/SkFontHost_none.cpp @@ -40,11 +40,6 @@ void SkFontHost::FilterRec(SkScalerContext::Rec* rec) { /////////////////////////////////////////////////////////////////////////////// -bool SkFontHost::ValidFontID(uint32_t uniqueID) { - SkDEBUGFAIL("SkFontHost::ResolveTypeface unimplemented"); - return false; -} - SkStream* SkFontHost::OpenStream(uint32_t uniqueID) { SkDEBUGFAIL("SkFontHost::OpenStream unimplemented"); return NULL; diff --git a/src/ports/SkFontHost_simple.cpp b/src/ports/SkFontHost_simple.cpp index f94226e71a..eef4dd7306 100644 --- a/src/ports/SkFontHost_simple.cpp +++ b/src/ports/SkFontHost_simple.cpp @@ -559,12 +559,6 @@ SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace, return tf; } -bool SkFontHost::ValidFontID(uint32_t fontID) { - SkAutoMutexAcquire ac(gFamilyMutex); - - return find_from_uniqueID(fontID) != NULL; -} - SkStream* SkFontHost::OpenStream(uint32_t fontID) { SkAutoMutexAcquire ac(gFamilyMutex); diff --git a/src/utils/ios/SkFontHost_iOS.mm b/src/utils/ios/SkFontHost_iOS.mm index 0cde81e741..b74b29f1f8 100755 --- a/src/utils/ios/SkFontHost_iOS.mm +++ b/src/utils/ios/SkFontHost_iOS.mm @@ -183,10 +183,6 @@ SkTypeface* SkFontHost::CreateTypefaceFromFile(char const*) { /////////////////////////////////////////////////////////////////////////////// -bool SkFontHost::ValidFontID(uint32_t uniqueID) { - return true; -} - SkStream* SkFontHost::OpenStream(uint32_t uniqueID) { SkTypeface_Stream* tf = find_by_id(uniqueID); SkASSERT(tf); -- cgit v1.2.3