diff --git a/gfx/2d/DrawTargetCG.cpp b/gfx/2d/DrawTargetCG.cpp index 98f5ce75d7c6..d8f703e83d9e 100644 --- a/gfx/2d/DrawTargetCG.cpp +++ b/gfx/2d/DrawTargetCG.cpp @@ -1338,6 +1338,7 @@ DrawTargetCG::Init(BackendType aType, // XXX: Create input parameter to control interpolation and // use the default for content. CGContextSetInterpolationQuality(mCg, kCGInterpolationLow); + CGContextSetShouldSmoothFonts(mCg, GetPermitSubpixelAA()); if (aType == BACKEND_COREGRAPHICS_ACCELERATED) { @@ -1377,6 +1378,7 @@ DrawTargetCG::Init(CGContextRef cgContext, const IntSize &aSize) mSize = aSize; mCg = cgContext; + CGContextSetShouldSmoothFonts(mCg, GetPermitSubpixelAA()); CGContextRetain(mCg); assert(mCg); @@ -1530,6 +1532,12 @@ DrawTargetCG::MarkChanged() } } +void +DrawTargetCG::SetPermitSubpixelAA(bool aPermitSubpixelAA) { + DrawTarget::SetPermitSubpixelAA(aPermitSubpixelAA); + CGContextSetShouldSmoothFonts(mCg, aPermitSubpixelAA); +} + CGContextRef BorrowedCGContext::BorrowCGContextFromDrawTarget(DrawTarget *aDT) { diff --git a/gfx/2d/DrawTargetCG.h b/gfx/2d/DrawTargetCG.h index 3a972852d06d..a46acdc14ff4 100644 --- a/gfx/2d/DrawTargetCG.h +++ b/gfx/2d/DrawTargetCG.h @@ -154,6 +154,7 @@ public: virtual IntSize GetSize() { return mSize; } + virtual void SetPermitSubpixelAA(bool aPermitSubpixelAA) MOZ_OVERRIDE; /* This is for creating good compatible surfaces */ virtual TemporaryRef CreateSourceSurfaceFromData(unsigned char *aData,