From c54e2502b014486da8e9cc373aa8a99fef86ed48 Mon Sep 17 00:00:00 2001 From: Job Bautista Date: Wed, 5 Apr 2023 18:31:13 +0800 Subject: [PATCH] Issue #2191 - Make ScaledFont::SetCairoScaledFont virtual so it can be accessed from outside Moz2D. Backported from Mozilla bug 1385029. --- gfx/2d/2D.h | 3 +++ gfx/2d/ScaledFontBase.h | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gfx/2d/2D.h b/gfx/2d/2D.h index e2020dc9e6..7c37a7f6b8 100644 --- a/gfx/2d/2D.h +++ b/gfx/2d/2D.h @@ -718,6 +718,9 @@ public: return mUserData.Get(key); } + virtual cairo_scaled_font_t* GetCairoScaledFont() { return nullptr; } + virtual void SetCairoScaledFont(cairo_scaled_font_t* font) {} + protected: ScaledFont() {} diff --git a/gfx/2d/ScaledFontBase.h b/gfx/2d/ScaledFontBase.h index e4bb4f2f8c..93541c4114 100644 --- a/gfx/2d/ScaledFontBase.h +++ b/gfx/2d/ScaledFontBase.h @@ -48,8 +48,8 @@ public: #ifdef USE_CAIRO_SCALED_FONT bool PopulateCairoScaledFont(); - cairo_scaled_font_t* GetCairoScaledFont() { return mScaledFont; } - void SetCairoScaledFont(cairo_scaled_font_t* font); + virtual cairo_scaled_font_t* GetCairoScaledFont() { return mScaledFont; } + virtual void SetCairoScaledFont(cairo_scaled_font_t* font); #endif protected: