remove SkFontHost::CreateScalerContext
Review URL: https://codereview.chromium.org/12593013
git-svn-id: http://skia.googlecode.com/svn/trunk@8228 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index ae1e75e..674f1fd 100755
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -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,23 +1716,12 @@
///////////////////////////////////////////////////////////////////////////////
// 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;
-}
-
-// DEPRECATED
-void SkFontHost::FilterRec(SkScalerContext::Rec* rec, SkTypeface* face) {
- face->onFilterRec(rec);
+ return SkSafeRef(face);
}
// DEPRECATED
@@ -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 {