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

Unified Diff: src/ports/SkFontHost_mac.cpp

Issue 12593013: remove SkFontHost::CreateScalerContext (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
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 | « src/ports/SkFontHost_linux.cpp ('k') | src/ports/SkFontHost_none.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_mac.cpp
===================================================================
--- src/ports/SkFontHost_mac.cpp (revision 8224)
+++ src/ports/SkFontHost_mac.cpp (working copy)
@@ -610,8 +610,8 @@
class SkScalerContext_Mac : public SkScalerContext {
public:
- SkScalerContext_Mac(const SkDescriptor* desc);
- virtual ~SkScalerContext_Mac(void);
+ SkScalerContext_Mac(SkTypeface_Mac*, const SkDescriptor*);
+ virtual ~SkScalerContext_Mac();
protected:
@@ -646,10 +646,13 @@
bool fVertical;
friend class Offscreen;
+
+ typedef SkScalerContext INHERITED;
};
-SkScalerContext_Mac::SkScalerContext_Mac(const SkDescriptor* desc)
- : SkScalerContext(desc)
+SkScalerContext_Mac::SkScalerContext_Mac(SkTypeface_Mac* typeface,
+ const SkDescriptor* desc)
+ : INHERITED(typeface, desc)
, fFBoundingBoxes(NULL)
, fFBoundingBoxesGlyphOffset(0)
, fGeneratedFBoundingBoxes(false)
@@ -1713,26 +1716,15 @@
///////////////////////////////////////////////////////////////////////////////
// DEPRECATED
-SkScalerContext* SkFontHost::CreateScalerContext(const SkDescriptor* desc) {
- return new SkScalerContext_Mac(desc);
-}
-
-// DEPRECATED
-SkFontID SkFontHost::NextLogicalFont(SkFontID currFontID, SkFontID origFontID) {
- SkFontID nextFontID = 0;
+SkTypeface* SkFontHost::NextLogicalTypeface(SkFontID currFontID, SkFontID origFontID) {
SkTypeface* face = GetDefaultFace();
- if (face->uniqueID() != currFontID) {
- nextFontID = face->uniqueID();
+ if (face->uniqueID() == currFontID) {
+ face = NULL;
}
- return nextFontID;
+ return SkSafeRef(face);
}
// DEPRECATED
-void SkFontHost::FilterRec(SkScalerContext::Rec* rec, SkTypeface* face) {
- face->onFilterRec(rec);
-}
-
-// DEPRECATED
int SkFontHost::CountTables(SkFontID fontID) {
SkTypeface* face = SkTypefaceCache::FindByID(fontID);
return face ? face->onGetTableTags(NULL) : 0;
@@ -1815,7 +1807,7 @@
}
SkScalerContext* SkTypeface_Mac::onCreateScalerContext(const SkDescriptor* desc) const {
- return new SkScalerContext_Mac(desc);
+ return new SkScalerContext_Mac(const_cast<SkTypeface_Mac*>(this), desc);
}
void SkTypeface_Mac::onFilterRec(SkScalerContextRec* rec) const {
« no previous file with comments | « src/ports/SkFontHost_linux.cpp ('k') | src/ports/SkFontHost_none.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698