Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1974)

Unified Diff: trunk/src/ports/SkFontHost_android.cpp

Issue 12706010: Add SkTypeface* parameter to SkScalerContext (and its callers) (Closed) Base URL: http://skia.googlecode.com/svn/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: trunk/src/ports/SkFontHost_android.cpp
===================================================================
--- trunk/src/ports/SkFontHost_android.cpp (revision 8166)
+++ trunk/src/ports/SkFontHost_android.cpp (working copy)
@@ -6,6 +6,7 @@
*/
#include "SkFontHost.h"
+#include "SkFontHost_FreeType_common.h"
#include "SkFontDescriptor.h"
#include "SkGraphics.h"
#include "SkDescriptor.h"
@@ -281,11 +282,11 @@
///////////////////////////////////////////////////////////////////////////////
-class FamilyTypeface : public SkTypeface {
+class FamilyTypeface : public SkTypeface_FreeType {
public:
FamilyTypeface(Style style, bool sysFont, SkTypeface* familyMember,
bool isFixedWidth)
- : SkTypeface(style, sk_atomic_inc(&gUniqueFontID) + 1, isFixedWidth) {
+ : INHERITED(style, sk_atomic_inc(&gUniqueFontID) + 1, isFixedWidth) {
fIsSysFont = sysFont;
// our caller has acquired the gFamilyHeadAndNameListMutex so this is safe
@@ -320,7 +321,7 @@
private:
bool fIsSysFont;
- typedef SkTypeface INHERITED;
+ typedef SkTypeface_FreeType INHERITED;
};
///////////////////////////////////////////////////////////////////////////////
@@ -884,13 +885,13 @@
}
}
-SkFontID SkFontHost::NextLogicalFont(SkFontID currFontID, SkFontID origFontID) {
+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
// enable clients such as WebKit to customize their font selection.
// Clients can use GetFallbackFamilyNameForChar() to get the fallback
// font for individual characters.
- return 0;
+ return NULL;
#else
SkAutoMutexAcquire ac(gFamilyHeadAndNameListMutex);
@@ -916,9 +917,9 @@
for (int i = 0; list[i] != 0; i++) {
if (list[i] == currFontID) {
if (list[i+1] == 0)
- return 0;
+ return NULL;
const SkTypeface* nextTypeface = find_from_uniqueID(list[i+1]);
- return find_typeface(nextTypeface, origTypeface->style())->uniqueID();
+ return SkRef(find_typeface(nextTypeface, origTypeface->style()));
}
}
@@ -926,7 +927,7 @@
// beginning of our list. Assuming there is at least one fallback font,
// i.e. gFallbackFonts[0] != 0.
const SkTypeface* firstTypeface = find_from_uniqueID(list[0]);
- return find_typeface(firstTypeface, origTypeface->style())->uniqueID();
+ return SkRef(find_typeface(firstTypeface, origTypeface->style()));
#endif
}

Powered by Google App Engine
This is Rietveld 408576698