Bug 1028497 - Part 14: Rename some methods to talk about UserFontEntry instead of FontFace. r=jdaggett

How that we have a class named "FontFace", it's a bit confusing for some
of the gfxUserFontSet methods to have "FontFace" in their names, so I'm
renaming them to mention "UserFontEntry" instead.
This commit is contained in:
Cameron McCormack 2014-10-02 12:32:07 +10:00
parent 21a470ab25
commit 05b2c9ef9c
4 changed files with 31 additions and 28 deletions

View File

@ -673,7 +673,7 @@ gfxUserFontSet::~gfxUserFontSet()
}
already_AddRefed<gfxUserFontEntry>
gfxUserFontSet::FindOrCreateFontFace(
gfxUserFontSet::FindOrCreateUserFontEntry(
const nsAString& aFamilyName,
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
uint32_t aWeight,
@ -700,9 +700,9 @@ gfxUserFontSet::FindOrCreateFontFace(
}
if (!entry) {
entry = CreateFontFace(aFontFaceSrcList, aWeight, aStretch,
aItalicStyle, aFeatureSettings, aLanguageOverride,
aUnicodeRanges);
entry = CreateUserFontEntry(aFontFaceSrcList, aWeight, aStretch,
aItalicStyle, aFeatureSettings,
aLanguageOverride, aUnicodeRanges);
entry->mFamilyName = aFamilyName;
#ifdef PR_LOGGING
@ -721,7 +721,8 @@ gfxUserFontSet::FindOrCreateFontFace(
}
already_AddRefed<gfxUserFontEntry>
gfxUserFontSet::CreateFontFace(const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
gfxUserFontSet::CreateUserFontEntry(
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
uint32_t aWeight,
int32_t aStretch,
uint32_t aItalicStyle,
@ -774,8 +775,8 @@ gfxUserFontSet::FindExistingUserFontEntry(
}
void
gfxUserFontSet::AddFontFace(const nsAString& aFamilyName,
gfxUserFontEntry* aUserFontEntry)
gfxUserFontSet::AddUserFontEntry(const nsAString& aFamilyName,
gfxUserFontEntry* aUserFontEntry)
{
gfxUserFontFamily* family = GetFamily(aFamilyName);
family->AddFontEntry(aUserFontEntry);

View File

@ -154,7 +154,7 @@ public:
// italic style = constants in gfxFontConstants.h, e.g. NS_FONT_STYLE_NORMAL
// language override = result of calling gfxFontStyle::ParseFontLanguageOverride
// TODO: support for unicode ranges not yet implemented
virtual already_AddRefed<gfxUserFontEntry> CreateFontFace(
virtual already_AddRefed<gfxUserFontEntry> CreateUserFontEntry(
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
uint32_t aWeight,
int32_t aStretch,
@ -165,7 +165,7 @@ public:
// creates a font face for the specified family, or returns an existing
// matching entry on the family if there is one
already_AddRefed<gfxUserFontEntry> FindOrCreateFontFace(
already_AddRefed<gfxUserFontEntry> FindOrCreateUserFontEntry(
const nsAString& aFamilyName,
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
uint32_t aWeight,
@ -176,8 +176,8 @@ public:
gfxSparseBitSet* aUnicodeRanges);
// add in a font face for which we have the gfxUserFontEntry already
void AddFontFace(const nsAString& aFamilyName,
gfxUserFontEntry* aUserFontEntry);
void AddUserFontEntry(const nsAString& aFamilyName,
gfxUserFontEntry* aUserFontEntry);
// Whether there is a face with this family name
bool HasFamily(const nsAString& aFamilyName) const
@ -443,7 +443,7 @@ protected:
// helper method for performing the actual userfont set rebuild
virtual void DoRebuildUserFontSet() = 0;
// helper method for FindOrCreateFontFace
// helper method for FindOrCreateUserFontEntry
gfxUserFontEntry* FindExistingUserFontEntry(
gfxUserFontFamily* aFamily,
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,

View File

@ -461,7 +461,7 @@ FontFaceSet::InsertRule(nsCSSFontFaceRule* aRule, uint8_t aSheetType,
}
}
mUserFontSet->AddFontFace(fontfamily, ruleRec.mUserFontEntry);
mUserFontSet->AddUserFontEntry(fontfamily, ruleRec.mUserFontEntry);
mRules.AppendElement(ruleRec);
aOldRules.RemoveElementAt(i);
// note the set has been modified if an old rule was skipped to find
@ -476,7 +476,7 @@ FontFaceSet::InsertRule(nsCSSFontFaceRule* aRule, uint8_t aSheetType,
// this is a new rule:
FontFaceRuleRecord ruleRec;
ruleRec.mUserFontEntry =
FindOrCreateFontFaceFromRule(fontfamily, aRule, aSheetType);
FindOrCreateUserFontEntryFromRule(fontfamily, aRule, aSheetType);
if (!ruleRec.mUserFontEntry) {
return;
@ -486,10 +486,11 @@ FontFaceSet::InsertRule(nsCSSFontFaceRule* aRule, uint8_t aSheetType,
ruleRec.mContainer.mSheetType = aSheetType;
// Add the entry to the end of the list. If an existing userfont entry was
// returned by FindOrCreateFontFaceFromRule that was already stored on the
// family, gfxUserFontFamily::AddFontEntry(), which AddFontFace calls,
// will automatically remove the earlier occurrence of the same userfont entry.
mUserFontSet->AddFontFace(fontfamily, ruleRec.mUserFontEntry);
// returned by FindOrCreateUserFontEntryFromRule that was already stored on
// the family, gfxUserFontFamily::AddFontEntry(), which AddUserFontEntry
// calls, will automatically remove the earlier occurrence of the same
// userfont entry.
mUserFontSet->AddUserFontEntry(fontfamily, ruleRec.mUserFontEntry);
mRules.AppendElement(ruleRec);
@ -498,9 +499,9 @@ FontFaceSet::InsertRule(nsCSSFontFaceRule* aRule, uint8_t aSheetType,
}
already_AddRefed<gfxUserFontEntry>
FontFaceSet::FindOrCreateFontFaceFromRule(const nsAString& aFamilyName,
nsCSSFontFaceRule* aRule,
uint8_t aSheetType)
FontFaceSet::FindOrCreateUserFontEntryFromRule(const nsAString& aFamilyName,
nsCSSFontFaceRule* aRule,
uint8_t aSheetType)
{
nsCSSValue val;
uint32_t unit;
@ -660,10 +661,11 @@ FontFaceSet::FindOrCreateFontFaceFromRule(const nsAString& aFamilyName,
}
nsRefPtr<gfxUserFontEntry> entry =
mUserFontSet->FindOrCreateFontFace(aFamilyName, srcArray, weight, stretch,
italicStyle, featureSettings,
languageOverride,
nullptr /* aUnicodeRanges */);
mUserFontSet->FindOrCreateUserFontEntry(aFamilyName, srcArray, weight,
stretch, italicStyle,
featureSettings,
languageOverride,
nullptr /* aUnicodeRanges */);
return entry.forget();
}
@ -1060,7 +1062,7 @@ FontFaceSet::UserFontSet::DoRebuildUserFontSet()
}
/* virtual */ already_AddRefed<gfxUserFontEntry>
FontFaceSet::UserFontSet::CreateFontFace(
FontFaceSet::UserFontSet::CreateUserFontEntry(
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
uint32_t aWeight,
int32_t aStretch,

View File

@ -73,7 +73,7 @@ public:
uint32_t aFlags = nsIScriptError::errorFlag,
nsresult aStatus = NS_OK) MOZ_OVERRIDE;
virtual void DoRebuildUserFontSet() MOZ_OVERRIDE;
virtual already_AddRefed<gfxUserFontEntry> CreateFontFace(
virtual already_AddRefed<gfxUserFontEntry> CreateUserFontEntry(
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
uint32_t aWeight,
int32_t aStretch,
@ -161,7 +161,7 @@ private:
nsTArray<FontFaceRuleRecord>& oldRules,
bool& aFontSetModified);
already_AddRefed<gfxUserFontEntry> FindOrCreateFontFaceFromRule(
already_AddRefed<gfxUserFontEntry> FindOrCreateUserFontEntryFromRule(
const nsAString& aFamilyName,
nsCSSFontFaceRule* aRule,
uint8_t aSheetType);