Bug 758120: Block attempts to do manual subpixel-AA on bitmap fonts. r=jfkthame

This commit is contained in:
Bas Schouten 2012-05-24 17:43:55 +02:00
parent bef0f6ea46
commit d15827520e
3 changed files with 12 additions and 0 deletions

View File

@ -35,6 +35,8 @@ public:
virtual bool SetupCairoFont(gfxContext *aContext);
virtual bool AllowSubpixelAA() { return mAllowManualShowGlyphs; }
virtual bool IsValid();
gfxFloat GetAdjustedSize() {

View File

@ -1788,6 +1788,12 @@ gfxFont::Draw(gfxTextRun *aTextRun, PRUint32 aStart, PRUint32 aEnd,
return;
}
bool oldSubpixelAA = dt->GetPermitSubpixelAA();
if (!AllowSubpixelAA()) {
dt->SetPermitSubpixelAA(false);
}
GlyphBufferAzure glyphs;
Glyph *glyph;
@ -1950,6 +1956,8 @@ gfxFont::Draw(gfxTextRun *aTextRun, PRUint32 aStart, PRUint32 aEnd,
renderingOptions, aContext, passedInvMatrix, true);
dt->SetTransform(oldMat);
dt->SetPermitSubpixelAA(oldSubpixelAA);
}
// Restore matrix for stroke pattern

View File

@ -1457,6 +1457,8 @@ public:
// This is called by the default Draw() implementation above.
virtual bool SetupCairoFont(gfxContext *aContext) = 0;
virtual bool AllowSubpixelAA() { return true; }
bool IsSyntheticBold() { return mApplySyntheticBold; }
// Amount by which synthetic bold "fattens" the glyphs: 1/16 of the em-size