b=449356 remove accidentally added code
authorKarl Tomlinson <karlt+@karlt.net>
Fri, 07 Nov 2008 15:37:52 +1300
changeset 21409 b39e3a7974f28358edc4b3f820a09850f4f6c341
parent 21408 707da21015e7d5439867d26e24f3c3ea9163f9da
child 21410 18fec592b35be494840d4b9dff01f61954fd917a
push id3539
push userktomlinson@mozilla.com
push dateFri, 07 Nov 2008 02:38:02 +0000
treeherdermozilla-central@b39e3a7974f2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs449356
milestone1.9.1b2pre
b=449356 remove accidentally added code
gfx/thebes/public/gfxFont.h
gfx/thebes/src/gfxFontconfigUtils.cpp
gfx/thebes/src/gfxPangoFonts.cpp
--- a/gfx/thebes/public/gfxFont.h
+++ b/gfx/thebes/public/gfxFont.h
@@ -1531,29 +1531,16 @@ public:
 
     PRBool Equals(const gfxFontGroup& other) const {
         return mFamilies.Equals(other.mFamilies) &&
             mStyle.Equals(other.mStyle);
     }
 
     const gfxFontStyle *GetStyle() const { return &mStyle; }
 
-#if !MOZ_WIDGET_GTK2
-#error "don't bother building"
-#endif
-#if 0
-    virtual const gfxFont::Metrics& GetMetrics() const {
-        gfxFont *firstFont = GetFontAt(0);
-        if (!firstFont) // OOM
-            return gfxFont::Metrics();
-        return firstFont->GetMetrics();
-    }
-#endif
-
-    // Used in nsTextRunTransformations: rename to GetSimilar
     virtual gfxFontGroup *Copy(const gfxFontStyle *aStyle) = 0;
 
     /**
      * The listed characters should not be passed in to MakeTextRun and should
      * be treated as invisible and zero-width.
      */
     static PRBool IsInvalidChar(PRUnichar ch);
     
--- a/gfx/thebes/src/gfxFontconfigUtils.cpp
+++ b/gfx/thebes/src/gfxFontconfigUtils.cpp
@@ -256,40 +256,16 @@ gfxFontconfigUtils::NewPattern(const nsS
 gfxFontconfigUtils::gfxFontconfigUtils()
     : mLastConfig(NULL)
 {
     mFontsByFamily.Init(50);
     mLangSupportTable.Init(20);
     UpdateFontListInternal();
 }
 
-#if 0
-PR_STATIC_CALLBACK(PLDHashOperator)
-GetFamilyNamesCallback(FamilyHashEntry *aEntry, void *aData)
-{
-    nsStringArray *names = static_cast<nsStringArray *>(aData);
-
-    const FcChar8 *name = aEntry->GetName();
-
-    // XXXkt only want to return entries for which GetStandardFamilyName
-    // returns the same family.
-    names.AppendString(NS_ConvertUTF8toUTF16(ToCString(sname)));
-}
-
-    if (aLangGroup.IsEmpty()) {
-        nsresult rv = UpdateFontListInternal();
-        if (NS_FAILED(rv))
-            return rv;
-
-        mFonts.EnumerateEntries(GetFamilyNamesCallback, &aListOfFonts);
-
-    } else {
-    }
-#endif
-
 nsresult
 gfxFontconfigUtils::GetFontList(const nsACString& aLangGroup,
                                 const nsACString& aGenericFamily,
                                 nsStringArray& aListOfFonts)
 {
     aListOfFonts.Clear();
 
     nsCStringArray fonts;
@@ -643,17 +619,16 @@ gfxFontconfigUtils::GetStandardFamilyNam
         return rv;
 
     NS_ConvertUTF16toUTF8 fontname(aFontName);
 
     // return empty string if no such family exists
     if (!IsExistingFamily(fontname))
         return NS_OK;
 
-    // XXXkt this could use mFontsByFamily.GetEntry()
     FcPattern *pat = NULL;
     FcObjectSet *os = NULL;
     FcFontSet *givenFS = NULL;
     nsCStringArray candidates;
     FcFontSet *candidateFS = NULL;
     rv = NS_ERROR_FAILURE;
 
     pat = FcPatternCreate();
--- a/gfx/thebes/src/gfxPangoFonts.cpp
+++ b/gfx/thebes/src/gfxPangoFonts.cpp
@@ -520,48 +520,25 @@ GetFontGroup(PangoContext *aContext)
 
 /**
  * gfxFcPangoFontSet:
  *
  * Translation from a desired FcPattern to a sorted set of font references
  * (fontconfig cache data) and (when needed) PangoFonts.
  */
 
-#if 0
-static int font_sets = 0;
-static int max_font_sets = 0;
-#endif
-
 class gfxFcPangoFontSet {
 public:
     THEBES_INLINE_DECL_REFCOUNTING(gfxFcPangoFontSet)
     
     explicit gfxFcPangoFontSet(FcPattern *aPattern)
         : mSortPattern(aPattern),
           mFcFontSet(SortPreferredFonts()), mFcFontsTrimmed(0),
           mHaveFallbackFonts(PR_FALSE)
     {
-#if 0
-        ++font_sets;
-        if (font_sets > max_font_sets) {
-            max_font_sets = font_sets;
-            fprintf(stderr, "font sets: %i\n", font_sets);
-        }
-#endif
-    }
-
-    ~gfxFcPangoFontSet()
-    {
-#if 0
-        --font_sets;
-#endif
-        PRInt32 last = mFonts.Length() - 1;
-        for (; last >= 0 && !mFonts[last].mFont; --last) ;
-        fprintf(stderr, "patterns/fonts allocated: %i/%i\n",
-                mFonts.Length(), last + 1);
     }
 
     // A reference is held by the FontSet.
     // The caller may add a ref to keep the font alive longer than the FontSet.
     PangoFont *GetFontAt(PRUint32 i)
     {
         if (i >= mFonts.Length() || !mFonts[i].mFont) { 
             // GetFontPatternAt sets up mFonts
@@ -1534,19 +1511,16 @@ gfxPangoFontGroup::Shutdown()
             // through its fonts.
             pango_fc_font_map_shutdown(PANGO_FC_FONT_MAP(gPangoFontMap));
         }
         g_object_unref(gPangoFontMap);
         gPangoFontMap = NULL;
     }
 
     NS_IF_RELEASE(gLangService);
-#if 0
-    fprintf(stderr, "font sets: %i\n", font_sets);
-#endif
 }
 
 static double
 GetPixelSize(FcPattern *aPattern)
 {
     double size;
     if (FcPatternGetDouble(aPattern,
                            FC_PIXEL_SIZE, 0, &size) == FcResultMatch)