diff options
author | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-03-04 17:37:51 +0000 |
---|---|---|
committer | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-03-04 17:37:51 +0000 |
commit | b1d9d2ef2803bd55fdc886d13033b48f8450dd14 (patch) | |
tree | 809ea85c71e5434cb012fbea4c165f9c6156e25f /src/ports/SkFontHost_mac.cpp | |
parent | 069b827f8e4f8ca212548719db64983a69b8dc25 (diff) |
Significant cleanup in api, and more importantly in sementics, of SkFontHost
- FindTypeface is now CreateTypeface, and what it returns is always considered
a new instance, even if it is from a cache (in which case it will have been
ref()'d. The caller must always balance its ownership by calling unref() on
the result when they are done.
- CloseStream is gone, since the caller can/must call stream->unref() when they
are done using it.
- ResolveTypeface is now ValidFontID, and just returns a bool.
git-svn-id: http://skia.googlecode.com/svn/trunk@109 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/ports/SkFontHost_mac.cpp')
-rwxr-xr-x | src/ports/SkFontHost_mac.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp index 969808e462..f0e3a93372 100755 --- a/src/ports/SkFontHost_mac.cpp +++ b/src/ports/SkFontHost_mac.cpp @@ -484,7 +484,7 @@ SkTypeface* SkFontHost::Deserialize(SkStream* stream) { return NULL; } -SkTypeface* SkFontHost::CreateTypeface(SkStream* stream) { +SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) { //Should not be used on Mac, keep linker happy SkASSERT(false); @@ -517,17 +517,8 @@ SkScalerContext* SkFontHost::CreateFallbackScalerContext(const SkScalerContext:: return SkFontHost::CreateScalerContext(desc); } - - /** Return the closest matching typeface given either an existing family - (specified by a typeface in that family) or by a familyName, and a - requested style. - 1) If familyFace is null, use famillyName. - 2) If famillyName is null, use familyFace. - 3) If both are null, return the default font that best matches style - This MUST not return NULL. - */ - -SkTypeface* SkFontHost::FindTypeface(const SkTypeface* familyFace, const char familyName[], SkTypeface::Style style) { +SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace, + const char familyName[], SkTypeface::Style style) { SkAutoMutexAcquire ac(gFTMutex); |