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

Unified Diff: src/ports/SkFontHost_win.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_simple.cpp ('k') | src/ports/SkFontHost_win_dw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_win.cpp
===================================================================
--- src/ports/SkFontHost_win.cpp (revision 8224)
+++ src/ports/SkFontHost_win.cpp (working copy)
@@ -190,6 +190,10 @@
SkFontID fontID = SkTypefaceCache::NewFontID();
return new LogFontTypeface(style, fontID, lf);
}
+
+protected:
+ virtual SkScalerContext* onCreateScalerContext(const SkDescriptor*) const SK_OVERRIDE;
+ virtual void onFilterRec(SkScalerContextRec*) const SK_OVERRIDE;
};
class FontMemResourceTypeface : public LogFontTypeface {
@@ -274,11 +278,11 @@
}
}
-SkFontID SkFontHost::NextLogicalFont(SkFontID currFontID, SkFontID origFontID) {
+SkTypeface* SkFontHost::NextLogicalTypeface(SkFontID currFontID, SkFontID origFontID) {
// Zero means that we don't have any fallback fonts for this fontID.
// This function is implemented on Android, but doesn't have much
// meaning here.
- return 0;
+ return NULL;
}
static void ensure_typeface_accessible(SkFontID fontID) {
@@ -481,7 +485,7 @@
class SkScalerContext_Windows : public SkScalerContext {
public:
- SkScalerContext_Windows(const SkDescriptor* desc);
+ SkScalerContext_Windows(SkTypeface*, const SkDescriptor* desc);
virtual ~SkScalerContext_Windows();
protected:
@@ -549,8 +553,9 @@
}
}
-SkScalerContext_Windows::SkScalerContext_Windows(const SkDescriptor* desc)
- : SkScalerContext(desc), fDDC(0), fFont(0), fSavefont(0), fSC(0)
+SkScalerContext_Windows::SkScalerContext_Windows(SkTypeface* typeface,
+ const SkDescriptor* desc)
+ : SkScalerContext(typeface, desc), fDDC(0), fFont(0), fSavefont(0), fSC(0)
, fGlyphCount(-1) {
SkAutoMutexAcquire ac(gFTMutex);
@@ -1608,8 +1613,8 @@
return 0;
}
-SkScalerContext* SkFontHost::CreateScalerContext(const SkDescriptor* desc) {
- return SkNEW_ARGS(SkScalerContext_Windows, (desc));
+SkScalerContext* LogFontTypeface::onCreateScalerContext(const SkDescriptor* desc) const {
+ return SkNEW_ARGS(SkScalerContext_Windows, (const_cast<LogFontTypeface*>(this), desc));
}
/** Return the closest matching typeface given either an existing family
@@ -1642,7 +1647,7 @@
return stream.get() ? CreateTypefaceFromStream(stream) : NULL;
}
-void SkFontHost::FilterRec(SkScalerContext::Rec* rec, SkTypeface* typeface) {
+void LogFontTypeface::onFilterRec(SkScalerContextRec* rec) const {
unsigned flagsWeDontSupport = SkScalerContext::kDevKernText_Flag |
SkScalerContext::kAutohinting_Flag |
SkScalerContext::kEmbeddedBitmapText_Flag |
@@ -1682,8 +1687,7 @@
}
#endif
- LogFontTypeface* logfontTypeface = static_cast<LogFontTypeface*>(typeface);
- if (!logfontTypeface->fCanBeLCD && isLCD(*rec)) {
+ if (!fCanBeLCD && isLCD(*rec)) {
rec->fMaskFormat = SkMask::kA8_Format;
rec->fFlags &= ~SkScalerContext::kGenA8FromLCD_Flag;
}
« no previous file with comments | « src/ports/SkFontHost_simple.cpp ('k') | src/ports/SkFontHost_win_dw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698