Bug 941095 - Part 1: Support SetPermitSubpixelAA with Quartz. r=bas

--HG--
extra : rebase_source : 69171a8a17a34c822b34f48babecf18ffa08bf56
This commit is contained in:
Benoit Girard 2013-12-11 23:16:03 -05:00
parent 0909f112c0
commit dc08516cff
2 changed files with 9 additions and 0 deletions

View File

@ -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)
{

View File

@ -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<SourceSurface> CreateSourceSurfaceFromData(unsigned char *aData,