Bug 998869 part 4 - rename fontgroup methods. r=heycam

This commit is contained in:
John Daggett 2014-09-25 12:16:54 +09:00
parent ec86ee2a35
commit b08eeaabee
6 changed files with 18 additions and 18 deletions

View File

@ -3103,7 +3103,7 @@ struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcess
virtual void SetText(const char16_t* text, int32_t length, nsBidiDirection direction)
{
mFontgrp->UpdateFontList(); // ensure user font generation is current
mFontgrp->UpdateUserFonts(); // ensure user font generation is current
mTextRun = mFontgrp->MakeTextRun(text,
length,
mThebes,
@ -3455,7 +3455,7 @@ CanvasRenderingContext2D::DrawOrMeasureText(const nsAString& aRawText,
processor.mPt.x -= anchorX * totalWidth;
// offset pt.y based on text baseline
processor.mFontgrp->UpdateFontList(); // ensure user font generation is current
processor.mFontgrp->UpdateUserFonts(); // ensure user font generation is current
NS_ASSERTION(processor.mFontgrp->FontListLength()>0, "font group contains no fonts");
const gfxFont::Metrics& fontMetrics =
processor.mFontgrp->GetFirstValidFont()->GetMetrics();

View File

@ -143,7 +143,7 @@ nsFontCache::GetMetricsFor(const nsFont& aFont, nsIAtom* aLanguage,
mFontMetrics.RemoveElementAt(i);
mFontMetrics.AppendElement(fm);
}
fm->GetThebesFontGroup()->UpdateFontList();
fm->GetThebesFontGroup()->UpdateUserFonts();
NS_ADDREF(aMetrics = fm);
return NS_OK;
}

View File

@ -1312,12 +1312,12 @@ gfxFont *
gfxPangoFontGroup::GetFontAt(int32_t i)
{
// If it turns out to be hard for all clients that cache font
// groups to call UpdateFontList at appropriate times, we could
// instead consider just calling UpdateFontList from someplace
// groups to call UpdateUserFonts at appropriate times, we could
// instead consider just calling UpdateUserFonts from someplace
// more central (such as here).
NS_ASSERTION(!mUserFontSet || mCurrGeneration == GetGeneration(),
"Whoever was caching this font group should have "
"called UpdateFontList on it");
"called UpdateUserFonts on it");
NS_PRECONDITION(i == 0, "Only have one font");
@ -1325,7 +1325,7 @@ gfxPangoFontGroup::GetFontAt(int32_t i)
}
void
gfxPangoFontGroup::UpdateFontList()
gfxPangoFontGroup::UpdateUserFonts()
{
uint64_t newGeneration = GetGeneration();
if (newGeneration == mCurrGeneration)

View File

@ -32,7 +32,7 @@ public:
virtual gfxFont *GetFontAt(int32_t i);
virtual void UpdateFontList();
virtual void UpdateUserFonts();
virtual already_AddRefed<gfxFont>
FindFontForChar(uint32_t aCh, uint32_t aPrevCh, int32_t aRunScript,

View File

@ -1469,7 +1469,7 @@ gfxFontGroup::gfxFontGroup(const FontFamilyList& aFontFamilyList,
, mSkipDrawing(false)
{
// We don't use SetUserFontSet() here, as we want to unconditionally call
// BuildFontList() rather than only do UpdateFontList() if it changed.
// BuildFontList() rather than only do UpdateUserFonts() if it changed.
mCurrGeneration = GetGeneration();
BuildFontList();
}
@ -2643,7 +2643,7 @@ gfxFontGroup::SetUserFontSet(gfxUserFontSet *aUserFontSet)
}
mUserFontSet = aUserFontSet;
mCurrGeneration = GetGeneration() - 1;
UpdateFontList();
UpdateUserFonts();
}
uint64_t
@ -2654,10 +2654,10 @@ gfxFontGroup::GetGeneration()
return mUserFontSet->GetGeneration();
}
// note: gfxPangoFontGroup overrides UpdateFontList, such that
// note: gfxPangoFontGroup overrides UpdateUserFonts, such that
// BuildFontList is never used
void
gfxFontGroup::UpdateFontList()
gfxFontGroup::UpdateUserFonts()
{
if (mCurrGeneration != GetGeneration()) {
// xxx - can probably improve this to detect when all fonts were found, so no need to update list

View File

@ -737,12 +737,12 @@ public:
virtual gfxFont *GetFontAt(int32_t i) {
// If it turns out to be hard for all clients that cache font
// groups to call UpdateFontList at appropriate times, we could
// instead consider just calling UpdateFontList from someplace
// groups to call UpdateUserFonts at appropriate times, we could
// instead consider just calling UpdateUserFonts from someplace
// more central (such as here).
NS_ASSERTION(!mUserFontSet || mCurrGeneration == GetGeneration(),
"Whoever was caching this font group should have "
"called UpdateFontList on it");
"called UpdateUserFonts on it");
NS_ASSERTION(mFonts.Length() > uint32_t(i) &&
(mFonts[i].Font() || mFonts[i].FontEntry()),
"Requesting a font index that doesn't exist");
@ -873,12 +873,12 @@ public:
gfxTextPerfMetrics *GetTextPerfMetrics() { return mTextPerf; }
void SetTextPerfMetrics(gfxTextPerfMetrics *aTextPerf) { mTextPerf = aTextPerf; }
// This will call UpdateFontList() if the user font set is changed.
// This will call UpdateUserFonts() if the user font set is changed.
void SetUserFontSet(gfxUserFontSet *aUserFontSet);
// If there is a user font set, check to see whether the font list or any
// caches need updating.
virtual void UpdateFontList();
virtual void UpdateUserFonts();
bool ShouldSkipDrawing() const {
return mSkipDrawing;
@ -891,7 +891,7 @@ public:
// The gfxFontGroup keeps ownership of this textrun.
// It is only guaranteed to exist until the next call to GetEllipsisTextRun
// (which might use a different appUnitsPerDev value) for the font group,
// or until UpdateFontList is called, or the fontgroup is destroyed.
// or until UpdateUserFonts is called, or the fontgroup is destroyed.
// Get it/use it/forget it :) - don't keep a reference that might go stale.
gfxTextRun* GetEllipsisTextRun(int32_t aAppUnitsPerDevPixel,
LazyReferenceContextGetter& aRefContextGetter);