Bug 791466 - Fix direct write cairo scaled font. r=Bas

This commit is contained in:
Brendan Dahl 2012-11-12 11:35:49 -08:00
parent 1b419bf3d2
commit 49dd7a2abe
3 changed files with 6 additions and 6 deletions

View File

@ -485,7 +485,7 @@ gfxDWriteFont::GetSpaceGlyph()
bool
gfxDWriteFont::SetupCairoFont(gfxContext *aContext)
{
cairo_scaled_font_t *scaledFont = CairoScaledFont();
cairo_scaled_font_t *scaledFont = GetCairoScaledFont();
if (cairo_scaled_font_status(scaledFont) != CAIRO_STATUS_SUCCESS) {
// Don't cairo_set_scaled_font as that would propagate the error to
// the cairo_t, precluding any further drawing.
@ -522,7 +522,7 @@ gfxDWriteFont::CairoFontFace()
cairo_scaled_font_t *
gfxDWriteFont::CairoScaledFont()
gfxDWriteFont::GetCairoScaledFont()
{
if (!mScaledFont) {
cairo_matrix_t sizeMatrix;
@ -763,7 +763,7 @@ gfxDWriteFont::GetScaledFont(mozilla::gfx::DrawTarget *aTarget)
if (wantCairo) {
mAzureScaledFont = Factory::CreateScaledFontWithCairo(nativeFont,
GetAdjustedSize(),
CairoScaledFont());
GetCairoScaledFont());
} else {
mAzureScaledFont = Factory::CreateScaledFontForNativeFont(nativeFont,
GetAdjustedSize());

View File

@ -71,6 +71,8 @@ public:
virtual mozilla::TemporaryRef<mozilla::gfx::ScaledFont> GetScaledFont(mozilla::gfx::DrawTarget *aTarget);
virtual cairo_scaled_font_t *GetCairoScaledFont();
protected:
friend class gfxDWriteShaper;
@ -84,8 +86,6 @@ protected:
cairo_font_face_t *CairoFontFace();
cairo_scaled_font_t *CairoScaledFont();
gfxFloat MeasureGlyphWidth(uint16_t aGlyph);
static void DestroyBlobFunc(void* userArg);

View File

@ -1262,7 +1262,7 @@ public:
const nsString& GetName() const { return mFontEntry->Name(); }
const gfxFontStyle *GetStyle() const { return &mStyle; }
cairo_scaled_font_t* GetCairoScaledFont() { return mScaledFont; }
virtual cairo_scaled_font_t* GetCairoScaledFont() { return mScaledFont; }
virtual gfxFont* CopyWithAntialiasOption(AntialiasOption anAAOption) {
// platforms where this actually matters should override