Bug 648385: Remove gfxFont::GetUniqueName, r=jdaggett
authorZack Weinberg <zackw@panix.com>
Mon, 11 Apr 2011 17:59:42 -0700
changeset 67879 525a9d7f34378a1b698ce67b5ecefe658d5fff33
parent 67878 1bc84edab09340adc2fb50c858b1ff2c71b7c1d4
child 67880 f7f2daa08d79efb969bf37165cfc36f97b9becde
push idunknown
push userunknown
push dateunknown
reviewersjdaggett
bugs648385
milestone2.2a1pre
Bug 648385: Remove gfxFont::GetUniqueName, r=jdaggett
gfx/thebes/gfxDWriteFonts.cpp
gfx/thebes/gfxDWriteFonts.h
gfx/thebes/gfxFT2FontBase.cpp
gfx/thebes/gfxFT2FontBase.h
gfx/thebes/gfxFont.cpp
gfx/thebes/gfxFont.h
gfx/thebes/gfxOS2Fonts.cpp
gfx/thebes/gfxOS2Fonts.h
--- a/gfx/thebes/gfxDWriteFonts.cpp
+++ b/gfx/thebes/gfxDWriteFonts.cpp
@@ -183,22 +183,16 @@ gfxDWriteFont::CopyWithAntialiasOption(A
 }
 
 void
 gfxDWriteFont::CreatePlatformShaper()
 {
     mPlatformShaper = new gfxDWriteShaper(this);
 }
 
-nsString
-gfxDWriteFont::GetUniqueName()
-{
-    return mFontEntry->Name();
-}
-
 const gfxFont::Metrics&
 gfxDWriteFont::GetMetrics()
 {
     return *mMetrics;
 }
 
 PRBool
 gfxDWriteFont::GetFakeMetricsForArialBlack(DWRITE_FONT_METRICS *aFontMetrics)
--- a/gfx/thebes/gfxDWriteFonts.h
+++ b/gfx/thebes/gfxDWriteFonts.h
@@ -56,18 +56,16 @@ public:
     gfxDWriteFont(gfxFontEntry *aFontEntry,
                   const gfxFontStyle *aFontStyle,
                   PRBool aNeedsBold = PR_FALSE,
                   AntialiasOption = kAntialiasDefault);
     ~gfxDWriteFont();
 
     virtual gfxFont* CopyWithAntialiasOption(AntialiasOption anAAOption);
 
-    virtual nsString GetUniqueName();
-
     virtual const gfxFont::Metrics& GetMetrics();
 
     virtual PRUint32 GetSpaceGlyph();
 
     virtual PRBool SetupCairoFont(gfxContext *aContext);
 
     virtual PRBool IsValid();
 
--- a/gfx/thebes/gfxFT2FontBase.cpp
+++ b/gfx/thebes/gfxFT2FontBase.cpp
@@ -165,22 +165,16 @@ gfxFT2FontBase::GetMetrics()
     fprintf (stderr, "    spaceWidth: %f aveCharWidth: %f xHeight: %f\n", mMetrics.spaceWidth, mMetrics.aveCharWidth, mMetrics.xHeight);
     fprintf (stderr, "    uOff: %f uSize: %f stOff: %f stSize: %f suOff: %f suSize: %f\n", mMetrics.underlineOffset, mMetrics.underlineSize, mMetrics.strikeoutOffset, mMetrics.strikeoutSize, mMetrics.superscriptOffset, mMetrics.subscriptOffset);
 #endif
 
     mHasMetrics = PR_TRUE;
     return mMetrics;
 }
 
-nsString
-gfxFT2FontBase::GetUniqueName()
-{
-    return GetName();
-}
-
 // Get the glyphID of a space
 PRUint32
 gfxFT2FontBase::GetSpaceGlyph()
 {
     NS_ASSERTION(GetStyle()->size != 0,
                  "forgot to short-circuit a text run with zero-sized font?");
     GetMetrics();
     return mSpaceGlyph;
--- a/gfx/thebes/gfxFT2FontBase.h
+++ b/gfx/thebes/gfxFT2FontBase.h
@@ -53,17 +53,16 @@ public:
                    gfxFontEntry *aFontEntry,
                    const gfxFontStyle *aFontStyle);
     virtual ~gfxFT2FontBase();
 
     PRUint32 GetGlyph(PRUint32 aCharCode);
     void GetGlyphExtents(PRUint32 aGlyph,
                          cairo_text_extents_t* aExtents);
     virtual const gfxFont::Metrics& GetMetrics();
-    virtual nsString GetUniqueName();
     virtual PRUint32 GetSpaceGlyph();
     virtual hb_blob_t *GetFontTable(PRUint32 aTag);
     virtual PRBool ProvidesGetGlyph() const { return PR_TRUE; }
     virtual PRUint32 GetGlyph(PRUint32 unicode, PRUint32 variation_selector);
     virtual PRBool ProvidesGlyphWidths() { return PR_TRUE; }
     virtual PRInt32 GetGlyphWidth(gfxContext *aCtx, PRUint16 aGID);
 
     cairo_scaled_font_t *CairoScaledFont() { return mScaledFont; };
--- a/gfx/thebes/gfxFont.cpp
+++ b/gfx/thebes/gfxFont.cpp
@@ -1238,18 +1238,19 @@ gfxFont::Draw(gfxTextRun *aTextRun, PRUi
         }
     }
 
     if (gfxFontTestStore::CurrentStore()) {
         /* This assumes that the tests won't have anything that results
          * in more than GLYPH_BUFFER_SIZE glyphs.  Do this before we
          * flush, since that'll blow away the num_glyphs.
          */
-        gfxFontTestStore::CurrentStore()->AddItem(GetUniqueName(),
-                                                  glyphs.mGlyphBuffer, glyphs.mNumGlyphs);
+        gfxFontTestStore::CurrentStore()->AddItem(GetName(),
+                                                  glyphs.mGlyphBuffer,
+                                                  glyphs.mNumGlyphs);
     }
 
     // draw any remaining glyphs
     glyphs.Flush(cr, aDrawToPath, isRTL, PR_TRUE);
 
     *aPt = gfxPoint(x, y);
 }
 
--- a/gfx/thebes/gfxFont.h
+++ b/gfx/thebes/gfxFont.h
@@ -953,18 +953,16 @@ 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 nsString GetUniqueName() { return GetName(); }
-
     virtual gfxFont* CopyWithAntialiasOption(AntialiasOption anAAOption) {
         // platforms where this actually matters should override
         return nsnull;
     }
 
     virtual gfxFloat GetAdjustedSize() {
         return mAdjustedSize > 0.0 ? mAdjustedSize : mStyle.size;
     }
--- a/gfx/thebes/gfxOS2Fonts.cpp
+++ b/gfx/thebes/gfxOS2Fonts.cpp
@@ -476,27 +476,16 @@ cairo_scaled_font_t *gfxOS2Font::CairoSc
                                            &identityMatrix, fontOptions);
     cairo_font_options_destroy(fontOptions);
 
     NS_ASSERTION(cairo_scaled_font_status(mScaledFont) == CAIRO_STATUS_SUCCESS,
                  "Failed to make scaled font");
     return mScaledFont;
 }
 
-nsString gfxOS2Font::GetUniqueName()
-{
-#ifdef DEBUG_thebes
-    printf("gfxOS2Font::GetUniqueName()=%s\n", (char *)GetName().get());
-#endif
-    // gfxFont::GetName() should already be unique enough
-    // Atsui uses that, too, while Win appends size, and properties...
-    // doesn't seem to get called at all anyway
-    return GetName();
-}
-
 PRBool gfxOS2Font::SetupCairoFont(gfxContext *aContext)
 {
 #ifdef DEBUG_thebes_2
     printf("gfxOS2Font[%#x]::SetupCairoFont(%#x)\n",
            (unsigned)this, (unsigned) aContext);
 #endif
     // gfxPangoFont checks the CTM but Windows doesn't so leave away here, too
 
--- a/gfx/thebes/gfxOS2Fonts.h
+++ b/gfx/thebes/gfxOS2Fonts.h
@@ -61,18 +61,16 @@ class gfxOS2Font : public gfxFont {
 public:
     gfxOS2Font(gfxOS2FontEntry *aFontEntry, const gfxFontStyle *aFontStyle);
     virtual ~gfxOS2Font();
 
     virtual const gfxFont::Metrics& GetMetrics();
     cairo_font_face_t *CairoFontFace();
     cairo_scaled_font_t *CairoScaledFont();
 
-    virtual nsString GetUniqueName();
-
     // Get the glyphID of a space
     virtual PRUint32 GetSpaceGlyph() {
         if (!mMetrics)
             GetMetrics();
         return mSpaceGlyph;
     }
 
     static already_AddRefed<gfxOS2Font> GetOrMakeFont(const nsAString& aName,