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 { |