Closed
Bug 1031202
Opened 11 years ago
Closed 11 years ago
factor out gfxMixedFontFamily lookup/creation into a helper function
Categories
(Core :: Graphics: Text, defect)
Core
Graphics: Text
Tracking
()
RESOLVED
FIXED
mozilla33
People
(Reporter: heycam, Assigned: heycam)
References
Details
Attachments
(1 file)
5.10 KB,
patch
|
jtd
:
review+
|
Details | Diff | Splinter Review |
There are a number of places in gfxUserFontSet where we look up mFontFamilies and perhaps create one if it doesn't exist. We should have functions for this so we don't have to duplicate this code.
Attachment #8447034 -
Flags: review?(jdaggett)
Comment 1•11 years ago
|
||
Comment on attachment 8447034 [details] [diff] [review]
patch
r+ with name change noted below.
gfx/thebes/gfxUserFontSet.cpp
@@ -661,27 +652,17 @@ gfxUserFontSet::AddFontFace(const nsAString& aFamilyName,
> -gfxFontFamily*
> +gfxMixedFontFamily*
> gfxUserFontSet::GetFamily(const nsAString& aFamilyName) const
> {
> nsAutoString key(aFamilyName);
> ToLowerCase(key);
>
> return mFontFamilies.GetWeak(key);
> }
>
> +gfxMixedFontFamily*
> +gfxUserFontSet::MaybeCreateFamily(const nsAString& aFamilyName)
> +{
> + nsAutoString key(aFamilyName);
> + ToLowerCase(key);
> +
> + gfxMixedFontFamily* family = mFontFamilies.GetWeak(key);
> + if (!family) {
> + family = new gfxMixedFontFamily(aFamilyName);
> + mFontFamilies.Put(key, family);
> + }
> + return family;
> +}
Rather than using the "Maybe" in a method name, in this case let's:
- switch GetFamily ==> LookupFamily
- use GetFamily instead of MaybeCreateFamily (with comment noting its behavior)
Attachment #8447034 -
Flags: review?(jdaggett) → review+
Assignee | ||
Comment 2•11 years ago
|
||
Comment 3•11 years ago
|
||
sorry had to backout this changes in https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=0294fdaef9be since one of this changes caused test failures like https://tbpl.mozilla.org/php/getParsedLog.php?id=43424728&tree=Mozilla-Inbound
Assignee | ||
Comment 4•11 years ago
|
||
Comment 5•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in
before you can comment on or make changes to this bug.
Description
•