зеркало из https://github.com/mozilla/gecko-dev.git
don't create a temp duplicate font list every time we need to get a font.... bug 329199. r=bz
This commit is contained in:
Родитель
e86dd357ac
Коммит
0abecc5523
|
@ -117,7 +117,7 @@ nsThebesFontMetrics::Destroy()
|
|||
|
||||
gfxFont::Metrics nsThebesFontMetrics::GetMetrics()
|
||||
{
|
||||
return mFontGroup->GetFontList()[0]->GetMetrics();
|
||||
return mFontGroup->GetFontAt(0)->GetMetrics();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -160,7 +160,6 @@ protected:
|
|||
const gfxFontStyle *mStyle;
|
||||
};
|
||||
|
||||
typedef nsTArray< nsRefPtr<gfxFont> > gfxFontVector;
|
||||
|
||||
class NS_EXPORT gfxFontGroup {
|
||||
public:
|
||||
|
@ -170,7 +169,13 @@ public:
|
|||
mFonts.Clear();
|
||||
}
|
||||
|
||||
gfxFontVector GetFontList() { return mFonts; }
|
||||
gfxFont *GetFontAt(PRInt32 i) {
|
||||
return NS_STATIC_CAST(gfxFont*, mFonts[i]);
|
||||
}
|
||||
PRUint32 FontListLength() const {
|
||||
return mFonts.Length();
|
||||
}
|
||||
|
||||
const gfxFontStyle *GetStyle() const { return &mStyle; }
|
||||
|
||||
/* unicode method */
|
||||
|
@ -189,7 +194,7 @@ protected:
|
|||
|
||||
nsString mFamilies;
|
||||
gfxFontStyle mStyle;
|
||||
gfxFontVector mFonts;
|
||||
nsTArray< nsRefPtr<gfxFont> > mFonts;
|
||||
};
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче