Bug 1385029 - remove virtual from gfxFont::GetCairoScaledFont. r=jfkthame
authorLee Salzman <lsalzman@mozilla.com>
Mon, 07 Aug 2017 16:20:48 -0400
changeset 422814 ffda55accd9ac78cd469c982afe1917cfeb6efb9
parent 422813 b1f2be9ad554279190fd751e8252330b912ecffb
child 422815 814688712ca461dd650e9a4cf80df274effc4a8c
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1385029
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1385029 - remove virtual from gfxFont::GetCairoScaledFont. r=jfkthame MozReview-Commit-ID: FNXL9aKtlKa
gfx/thebes/gfxDWriteFonts.cpp
gfx/thebes/gfxDWriteFonts.h
gfx/thebes/gfxFont.h
--- a/gfx/thebes/gfxDWriteFonts.cpp
+++ b/gfx/thebes/gfxDWriteFonts.cpp
@@ -455,17 +455,17 @@ uint32_t
 gfxDWriteFont::GetSpaceGlyph()
 {
     return mSpaceGlyph;
 }
 
 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.
         return false;
     }
     cairo_set_scaled_font(gfxFont::RefCairo(aDrawTarget), scaledFont);
     return true;
 }
@@ -492,17 +492,17 @@ gfxDWriteFont::CairoFontFace()
             ((gfxDWriteFontEntry*)mFontEntry.get())->mFont, mFontFace);
 #endif
     }
     return mCairoFontFace;
 }
 
 
 cairo_scaled_font_t *
-gfxDWriteFont::GetCairoScaledFont()
+gfxDWriteFont::InitCairoScaledFont()
 {
     if (!mScaledFont) {
         cairo_matrix_t sizeMatrix;
         cairo_matrix_t identityMatrix;
 
         cairo_matrix_init_scale(&sizeMatrix, mAdjustedSize, mAdjustedSize);
         cairo_matrix_init_identity(&identityMatrix);
 
@@ -706,17 +706,17 @@ gfxDWriteFont::GetScaledFont(mozilla::gf
                                                    params->GetEnhancedContrast());
         if (!mAzureScaledFont) {
             return nullptr;
         }
     }
 
     if (aTarget->GetBackendType() == BackendType::CAIRO) {
         if (!mAzureScaledFont->GetCairoScaledFont()) {
-            cairo_scaled_font_t* cairoScaledFont = GetCairoScaledFont();
+            cairo_scaled_font_t* cairoScaledFont = InitCairoScaledFont();
             if (!cairoScaledFont) {
                 return nullptr;
             }
             mAzureScaledFont->SetCairoScaledFont(cairoScaledFont);
         }
     }
 
     RefPtr<ScaledFont> scaledFont(mAzureScaledFont);
--- a/gfx/thebes/gfxDWriteFonts.h
+++ b/gfx/thebes/gfxDWriteFonts.h
@@ -66,19 +66,19 @@ public:
     virtual void AddSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
                                         FontCacheSizes* aSizes) const override;
 
     virtual FontType GetType() const override { return FONT_TYPE_DWRITE; }
 
     virtual already_AddRefed<mozilla::gfx::ScaledFont>
     GetScaledFont(mozilla::gfx::DrawTarget *aTarget) override;
 
-    virtual cairo_scaled_font_t *GetCairoScaledFont() override;
+protected:
+    cairo_scaled_font_t *InitCairoScaledFont();
 
-protected:
     virtual const Metrics& GetHorizontalMetrics() override;
 
     bool GetFakeMetricsForArialBlack(DWRITE_FONT_METRICS *aFontMetrics);
 
     void ComputeMetrics(AntialiasOption anAAOption);
 
     bool HasBitmapStrikeForSize(uint32_t aSize);
 
--- a/gfx/thebes/gfxFont.h
+++ b/gfx/thebes/gfxFont.h
@@ -1441,17 +1441,17 @@ public:
             // outside the hinted outline.
             // Also NOTE: it is relatively expensive to request this,
             // as it does not use cached glyph extents in the font.
     } BoundingBoxType;
 
     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<gfxFont>
     CopyWithAntialiasOption(AntialiasOption anAAOption) {
         // platforms where this actually matters should override
         return nullptr;
     }
 
     gfxFloat GetAdjustedSize() const {