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

Unified Diff: src/ports/SkFontHost_FreeType_common.h

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_FreeType.cpp ('k') | src/ports/SkFontHost_android.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_FreeType_common.h
===================================================================
--- src/ports/SkFontHost_FreeType_common.h (revision 8224)
+++ src/ports/SkFontHost_FreeType_common.h (working copy)
@@ -11,6 +11,8 @@
#include "SkGlyph.h"
#include "SkScalerContext.h"
+#include "SkTypeface.h"
+
#include <ft2build.h>
#include FT_FREETYPE_H
@@ -26,19 +28,34 @@
class SkScalerContext_FreeType_Base : public SkScalerContext {
-public:
+protected:
// See http://freetype.sourceforge.net/freetype2/docs/reference/ft2-bitmap_handling.html#FT_Bitmap_Embolden
// This value was chosen by eyeballing the result in Firefox and trying to match it.
static const FT_Pos kBitmapEmboldenStrength = 1 << 6;
-
- SkScalerContext_FreeType_Base(const SkDescriptor *desc)
- : SkScalerContext(desc)
+
+ SkScalerContext_FreeType_Base(SkTypeface* typeface, const SkDescriptor *desc)
+ : INHERITED(typeface, desc)
{}
-
-protected:
+
void generateGlyphImage(FT_Face face, const SkGlyph& glyph);
void generateGlyphPath(FT_Face face, SkPath* path);
void emboldenOutline(FT_Face face, FT_Outline* outline);
+
+private:
+ typedef SkScalerContext INHERITED;
};
+class SkTypeface_FreeType : public SkTypeface {
+protected:
+ SkTypeface_FreeType(Style style, SkFontID uniqueID, bool isFixedWidth)
+ : INHERITED(style, uniqueID, isFixedWidth) {}
+
+ virtual SkScalerContext* onCreateScalerContext(
+ const SkDescriptor*) const SK_OVERRIDE;
+ virtual void onFilterRec(SkScalerContextRec*) const SK_OVERRIDE;
+
+private:
+ typedef SkTypeface INHERITED;
+};
+
#endif // SKFONTHOST_FREETYPE_COMMON_H_
« no previous file with comments | « src/ports/SkFontHost_FreeType.cpp ('k') | src/ports/SkFontHost_android.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698