Bug 898267 - support font smoothing in Azure CG backend. r=jrmuizel

This commit is contained in:
John Daggett 2013-07-29 17:33:43 +09:00
parent f843bbb3ea
commit 79e2fd3173
2 changed files with 5 additions and 0 deletions

View File

@ -1007,6 +1007,9 @@ DrawTargetCG::FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer, const Pa
CGContextRef cg = fixer.Check(mCg, aDrawOptions.mCompositionOp);
CGContextSetAlpha(cg, aDrawOptions.mAlpha);
CGContextSetShouldAntialias(cg, aDrawOptions.mAntialiasMode != AA_NONE);
if (aDrawOptions.mAntialiasMode != AA_DEFAULT) {
CGContextSetShouldSmoothFonts(cg, aDrawOptions.mAntialiasMode == AA_SUBPIXEL);
}
CGContextConcatCTM(cg, GfxMatrixToCGAffineTransform(mTransform));

View File

@ -84,8 +84,10 @@ gfxMacFont::gfxMacFont(MacOSFontEntry *aFontEntry, const gfxFontStyle *aFontStyl
if (mAdjustedSize <=
(gfxFloat)gfxPlatformMac::GetPlatform()->GetAntiAliasingThreshold()) {
cairo_font_options_set_antialias(fontOptions, CAIRO_ANTIALIAS_NONE);
mAntialiasOption = kAntialiasNone;
} else if (mStyle.useGrayscaleAntialiasing) {
cairo_font_options_set_antialias(fontOptions, CAIRO_ANTIALIAS_GRAY);
mAntialiasOption = kAntialiasGrayscale;
}
mScaledFont = cairo_scaled_font_create(mFontFace, &sizeMatrix, &ctm,