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

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

Issue 12915003: call onGetUPEM to subclasses can optimize it, and place default behavior (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
« no previous file with comments | « trunk/src/core/SkTypeface.cpp ('k') | trunk/src/ports/SkFontHost_FreeType_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ports/SkFontHost_FreeType.cpp
===================================================================
--- trunk/src/ports/SkFontHost_FreeType.cpp (revision 8293)
+++ trunk/src/ports/SkFontHost_FreeType.cpp (working copy)
@@ -698,8 +698,7 @@
#endif
}
-#ifdef SK_BUILD_FOR_ANDROID
-uint32_t SkFontHost::GetUnitsPerEm(SkFontID fontID) {
+int SkTypeface_FreeType::onGetUPEM() const {
SkAutoMutexAcquire ac(gFTMutex);
FT_Library libInit = NULL;
if (gFTCount == 0) {
@@ -708,17 +707,16 @@
libInit = gFTLibrary;
}
SkAutoTCallIProc<struct FT_LibraryRec_, FT_Done_FreeType> ftLib(libInit);
- SkFaceRec *rec = ref_ft_face(fontID);
- uint16_t unitsPerEm = 0;
+ SkFaceRec *rec = ref_ft_face(this->uniqueID());
+ int unitsPerEm = 0;
if (rec != NULL && rec->fFace != NULL) {
unitsPerEm = rec->fFace->units_per_EM;
unref_ft_face(rec->fFace);
}
- return (uint32_t)unitsPerEm;
+ return unitsPerEm;
}
-#endif
SkScalerContext_FreeType::SkScalerContext_FreeType(SkTypeface* typeface,
const SkDescriptor* desc)
« no previous file with comments | « trunk/src/core/SkTypeface.cpp ('k') | trunk/src/ports/SkFontHost_FreeType_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698