Chromium Code Reviews| Index: trunk/src/ports/SkFontHost_win.cpp |
| =================================================================== |
| --- trunk/src/ports/SkFontHost_win.cpp (revision 8166) |
| +++ trunk/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) |
|
bungeman-skia
2013/03/15 16:12:44
A tab??
|
| + : 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 |
| @@ -1647,7 +1652,7 @@ |
| return face; |
| } |
| -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 | |
| @@ -1687,8 +1692,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; |
| } |