From cd4c972e1ca8ac1956f8aec799481a605e28d790 Mon Sep 17 00:00:00 2001 From: roytam1 Date: Fri, 7 Apr 2023 10:43:58 +0800 Subject: [PATCH] ported from UXP: Issue #2191 - Remove virtual from gfxFont::GetCairoScaledFont. (44b74873) --- gfx/thebes/gfxDWriteFonts.cpp | 6 +++--- gfx/thebes/gfxDWriteFonts.h | 4 ++-- gfx/thebes/gfxFont.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gfx/thebes/gfxDWriteFonts.cpp b/gfx/thebes/gfxDWriteFonts.cpp index d695533ca..9be3a1f36 100644 --- a/gfx/thebes/gfxDWriteFonts.cpp +++ b/gfx/thebes/gfxDWriteFonts.cpp @@ -468,7 +468,7 @@ gfxDWriteFont::GetSpaceGlyph() bool gfxDWriteFont::SetupCairoFont(DrawTarget* aDrawTarget) { - cairo_scaled_font_t *scaledFont = GetCairoScaledFont(); + cairo_scaled_font_t *scaledFont = InitCairoScaledFont(); 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. @@ -505,7 +505,7 @@ gfxDWriteFont::CairoFontFace() cairo_scaled_font_t * -gfxDWriteFont::GetCairoScaledFont() +gfxDWriteFont::InitCairoScaledFont() { if (!mScaledFont) { cairo_matrix_t sizeMatrix; @@ -703,7 +703,7 @@ gfxDWriteFont::GetScaledFont(mozilla::gfx::DrawTarget *aTarget) if (aTarget->GetBackendType() == BackendType::CAIRO) { if (!mAzureScaledFont->GetCairoScaledFont()) { - cairo_scaled_font_t* cairoScaledFont = GetCairoScaledFont(); + cairo_scaled_font_t* cairoScaledFont = InitCairoScaledFont(); if (!cairoScaledFont) { return nullptr; } diff --git a/gfx/thebes/gfxDWriteFonts.h b/gfx/thebes/gfxDWriteFonts.h index b7f5be657..d8843f446 100644 --- a/gfx/thebes/gfxDWriteFonts.h +++ b/gfx/thebes/gfxDWriteFonts.h @@ -71,9 +71,9 @@ public: virtual already_AddRefed GetScaledFont(mozilla::gfx::DrawTarget *aTarget) override; - virtual cairo_scaled_font_t *GetCairoScaledFont() override; - protected: + cairo_scaled_font_t *InitCairoScaledFont(); + virtual const Metrics& GetHorizontalMetrics() override; bool GetFakeMetricsForArialBlack(DWRITE_FONT_METRICS *aFontMetrics); diff --git a/gfx/thebes/gfxFont.h b/gfx/thebes/gfxFont.h index 55c645f4c..2796bf3e5 100644 --- a/gfx/thebes/gfxFont.h +++ b/gfx/thebes/gfxFont.h @@ -1467,7 +1467,7 @@ public: const nsString& GetName() const { return mFontEntry->Name(); } const gfxFontStyle *GetStyle() const { return &mStyle; } - virtual cairo_scaled_font_t* GetCairoScaledFont() { return mScaledFont; } + cairo_scaled_font_t* GetCairoScaledFont() { return mScaledFont; } virtual mozilla::UniquePtr CopyWithAntialiasOption(AntialiasOption anAAOption) {