Bug 1330423 - Remove redundant 'virtual' keyword from methods in the Mac font backend. r=jrmuizel
authorJonathan Kew <jkew@mozilla.com>
Wed, 18 Jan 2017 20:38:04 +0000
changeset 377327 4a772ea363ab231f7812753f0b77cf712423e124
parent 377326 fe7a8f94d0ad0f7262b950b353325624406d4133
child 377328 02fc9d9b46a58d20270c5dba699e3eef56370b80
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1330423
milestone53.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 1330423 - Remove redundant 'virtual' keyword from methods in the Mac font backend. r=jrmuizel
gfx/thebes/gfxMacFont.h
gfx/thebes/gfxMacPlatformFontList.h
--- a/gfx/thebes/gfxMacFont.h
+++ b/gfx/thebes/gfxMacFont.h
@@ -19,75 +19,75 @@ public:
     gfxMacFont(MacOSFontEntry *aFontEntry, const gfxFontStyle *aFontStyle,
                bool aNeedsBold);
 
     virtual ~gfxMacFont();
 
     CGFontRef GetCGFontRef() const { return mCGFont; }
 
     /* overrides for the pure virtual methods in gfxFont */
-    virtual uint32_t GetSpaceGlyph() override {
+    uint32_t GetSpaceGlyph() override {
         return mSpaceGlyph;
     }
 
-    virtual bool SetupCairoFont(DrawTarget* aDrawTarget) override;
+    bool SetupCairoFont(DrawTarget* aDrawTarget) override;
 
     /* override Measure to add padding for antialiasing */
-    virtual RunMetrics Measure(const gfxTextRun *aTextRun,
-                               uint32_t aStart, uint32_t aEnd,
-                               BoundingBoxType aBoundingBoxType,
-                               DrawTarget *aDrawTargetForTightBoundingBox,
-                               Spacing *aSpacing,
-                               uint16_t aOrientation) override;
+    RunMetrics Measure(const gfxTextRun *aTextRun,
+                       uint32_t aStart, uint32_t aEnd,
+                       BoundingBoxType aBoundingBoxType,
+                       DrawTarget *aDrawTargetForTightBoundingBox,
+                       Spacing *aSpacing,
+                       uint16_t aOrientation) override;
 
     // We need to provide hinted (non-linear) glyph widths if using a font
     // with embedded color bitmaps (Apple Color Emoji), as Core Text renders
     // the glyphs with non-linear scaling at small pixel sizes.
-    virtual bool ProvidesGlyphWidths() const override {
+    bool ProvidesGlyphWidths() const override {
         return mVariationFont ||
                mFontEntry->HasFontTable(TRUETYPE_TAG('s','b','i','x'));
     }
 
-    virtual int32_t GetGlyphWidth(DrawTarget& aDrawTarget,
-                                  uint16_t aGID) override;
+    int32_t GetGlyphWidth(DrawTarget& aDrawTarget,
+                          uint16_t aGID) override;
 
-    virtual already_AddRefed<mozilla::gfx::ScaledFont>
+    already_AddRefed<mozilla::gfx::ScaledFont>
     GetScaledFont(mozilla::gfx::DrawTarget *aTarget) override;
 
-    virtual already_AddRefed<mozilla::gfx::GlyphRenderingOptions>
+    already_AddRefed<mozilla::gfx::GlyphRenderingOptions>
       GetGlyphRenderingOptions(const TextRunDrawParams* aRunParams = nullptr) override;
 
-    virtual void AddSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
-                                        FontCacheSizes* aSizes) const override;
-    virtual void AddSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
-                                        FontCacheSizes* aSizes) const override;
+    void AddSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
+                                FontCacheSizes* aSizes) const override;
+    void AddSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
+                                FontCacheSizes* aSizes) const override;
 
-    virtual FontType GetType() const override { return FONT_TYPE_MAC; }
+    FontType GetType() const override { return FONT_TYPE_MAC; }
 
     // Helper to create a CTFont from a CGFont, with optional font descriptor
     // (for features), and copying any variations that were set on the CGFont.
     // This is public so that gfxCoreTextShaper can also use it.
     static CTFontRef
     CreateCTFontFromCGFontWithVariations(CGFontRef aCGFont,
                                          CGFloat aSize,
                                          CTFontDescriptorRef aFontDesc = nullptr);
 
 protected:
-    virtual const Metrics& GetHorizontalMetrics() override {
+    const Metrics& GetHorizontalMetrics() override {
         return mMetrics;
     }
 
     // override to prefer CoreText shaping with fonts that depend on AAT
-    virtual bool ShapeText(DrawTarget     *aDrawTarget,
-                           const char16_t *aText,
-                           uint32_t        aOffset,
-                           uint32_t        aLength,
-                           Script          aScript,
-                           bool            aVertical,
-                           gfxShapedText  *aShapedText) override;
+    bool ShapeText(DrawTarget     *aDrawTarget,
+                   const char16_t *aText,
+                   uint32_t        aOffset,
+                   uint32_t        aLength,
+                   Script          aScript,
+                   bool            aVertical,
+                   gfxShapedText  *aShapedText) override;
 
     void InitMetrics();
     void InitMetricsFromPlatform();
 
     // Get width and glyph ID for a character; uses aConvFactor
     // to convert font units as returned by CG to actual dimensions
     gfxFloat GetCharWidth(CFDataRef aCmap, char16_t aUniChar,
                           uint32_t *aGlyphID, gfxFloat aConvFactor);
--- a/gfx/thebes/gfxMacPlatformFontList.h
+++ b/gfx/thebes/gfxMacPlatformFontList.h
@@ -36,35 +36,36 @@ public:
     MacOSFontEntry(const nsAString& aPostscriptName, CGFontRef aFontRef,
                    uint16_t aWeight, uint16_t aStretch, uint8_t aStyle,
                    bool aIsDataUserFont, bool aIsLocal);
 
     virtual ~MacOSFontEntry() {
         ::CGFontRelease(mFontRef);
     }
 
-    virtual CGFontRef GetFontRef();
+    CGFontRef GetFontRef();
 
     // override gfxFontEntry table access function to bypass table cache,
     // use CGFontRef API to get direct access to system font data
-    virtual hb_blob_t *GetFontTable(uint32_t aTag) override;
+    hb_blob_t *GetFontTable(uint32_t aTag) override;
 
-    virtual void AddSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
-                                        FontListSizes* aSizes) const override;
+    void AddSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
+                                FontListSizes* aSizes) const override;
 
     nsresult ReadCMAP(FontInfoData *aFontInfoData = nullptr) override;
 
     bool RequiresAATLayout() const { return mRequiresAAT; }
 
     bool IsCFF();
 
 protected:
-    virtual gfxFont* CreateFontInstance(const gfxFontStyle *aFontStyle, bool aNeedsBold) override;
+    gfxFont* CreateFontInstance(const gfxFontStyle *aFontStyle,
+                                bool aNeedsBold) override;
 
-    virtual bool HasFontTable(uint32_t aTableTag) override;
+    bool HasFontTable(uint32_t aTableTag) override;
 
     static void DestroyBlobFunc(void* aUserData);
 
     CGFontRef mFontRef; // owning reference to the CGFont, released on destruction
 
     double mSizeHint;
 
     bool mFontRefInitialized;
@@ -115,42 +116,43 @@ public:
         kHiddenSystemFontFamily = 1, // hidden system family, not exposed to UI
         kTextSizeSystemFontFamily = 2, // name of 'system' font at text sizes
         kDisplaySizeSystemFontFamily = 3 // 'system' font at display sizes
     };
     void GetSystemFontFamilyList(
         InfallibleTArray<mozilla::dom::FontFamilyListEntry>* aList);
 
 protected:
-    virtual gfxFontFamily*
+    gfxFontFamily*
     GetDefaultFontForPlatform(const gfxFontStyle* aStyle) override;
 
 private:
     friend class gfxPlatformMac;
 
     gfxMacPlatformFontList();
     virtual ~gfxMacPlatformFontList();
 
     // initialize font lists
-    virtual nsresult InitFontListForPlatform() override;
+    nsresult InitFontListForPlatform() override;
 
     // special case font faces treated as font families (set via prefs)
     void InitSingleFaceList();
 
     // initialize system fonts
     void InitSystemFontNames();
 
     // helper function to lookup in both hidden system fonts and normal fonts
     gfxFontFamily* FindSystemFontFamily(const nsAString& aFamily);
 
-    static void RegisteredFontsChangedNotificationCallback(CFNotificationCenterRef center,
-                                                           void *observer,
-                                                           CFStringRef name,
-                                                           const void *object,
-                                                           CFDictionaryRef userInfo);
+    static void
+    RegisteredFontsChangedNotificationCallback(CFNotificationCenterRef center,
+                                               void *observer,
+                                               CFStringRef name,
+                                               const void *object,
+                                               CFDictionaryRef userInfo);
 
     // search fonts system-wide for a given character, null otherwise
     gfxFontEntry* GlobalFontFallback(const uint32_t aCh,
                                      Script aRunScript,
                                      const gfxFontStyle* aMatchStyle,
                                      uint32_t& aCmapCount,
                                      gfxFontFamily** aMatchedFamily) override;