From 92d47bc46f360beed55c98967f0884d8331b23b7 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Tue, 5 Nov 2013 17:50:56 +1300 Subject: [PATCH] Bug 926023 - Use the value of SetPermitSubpixelAA for DrawTargetCairo. r=Bas --- gfx/2d/2D.h | 2 +- gfx/2d/DrawTargetCairo.cpp | 8 ++++++++ gfx/2d/DrawTargetCairo.h | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gfx/2d/2D.h b/gfx/2d/2D.h index 9ad93ba05fea..01dbfaa4a893 100644 --- a/gfx/2d/2D.h +++ b/gfx/2d/2D.h @@ -888,7 +888,7 @@ public: return mOpaqueRect; } - void SetPermitSubpixelAA(bool aPermitSubpixelAA) { + virtual void SetPermitSubpixelAA(bool aPermitSubpixelAA) { mPermitSubpixelAA = aPermitSubpixelAA; } diff --git a/gfx/2d/DrawTargetCairo.cpp b/gfx/2d/DrawTargetCairo.cpp index ef56217e1932..0b8c7514bd1a 100644 --- a/gfx/2d/DrawTargetCairo.cpp +++ b/gfx/2d/DrawTargetCairo.cpp @@ -843,6 +843,14 @@ DrawTargetCairo::Fill(const Path *aPath, DrawPattern(aPattern, StrokeOptions(), aOptions, DRAW_FILL); } +void +DrawTargetCairo::SetPermitSubpixelAA(bool aPermitSubpixelAA) +{ + DrawTarget::SetPermitSubpixelAA(aPermitSubpixelAA); + cairo_surface_set_subpixel_antialiasing(mSurface, + aPermitSubpixelAA ? CAIRO_SUBPIXEL_ANTIALIASING_ENABLED : CAIRO_SUBPIXEL_ANTIALIASING_DISABLED); +} + void DrawTargetCairo::FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer, diff --git a/gfx/2d/DrawTargetCairo.h b/gfx/2d/DrawTargetCairo.h index 9308253dff94..690ea0d6e812 100644 --- a/gfx/2d/DrawTargetCairo.h +++ b/gfx/2d/DrawTargetCairo.h @@ -60,6 +60,8 @@ public: virtual TemporaryRef Snapshot(); virtual IntSize GetSize(); + virtual void SetPermitSubpixelAA(bool aPermitSubpixelAA); + virtual bool LockBits(uint8_t** aData, IntSize* aSize, int32_t* aStride, SurfaceFormat* aFormat); virtual void ReleaseBits(uint8_t* aData);