Closed Bug 226406 Opened 21 years ago Closed 21 years ago

[xft] instantiate unknown glyph (mini) font lazily

Categories

(Core Graveyard :: GFX: Gtk, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bryner, Assigned: bryner)

Details

(Keywords: perf)

Attachments

(1 file)

Even after the checkin for bug 223813, we still spend a fair amount of time in
font matching (and it's not speedy, so we should strive to do it as little as
possible). One thing I noticed is that we create mMiniFont up-front for a
nsFontXft, even though very few pages need to draw an unknown glyph character. 
We're spending nearly as much time doing font matching for the mini font as for
the main font.  I think we should instantiate the mini font only as needed.

It's also worth noting that the mini fonts could be reused across nsFontXft
instances, since the mini font depends only the size and weight of the primary
font, not its family.  I think the lazy instantiation will be a bigger win for
now though, since we need to draw unknown glyphs infrequently.
This patch removes the call to SetupMiniFont() in Init(), and instead calls
SetupMiniFont() prior to using any of the mMini* variables.
Attachment #136079 - Flags: superreview?(dbaron)
Attachment #136079 - Flags: review?(dbaron)
Attachment #136079 - Flags: superreview?(dbaron)
Attachment #136079 - Flags: superreview+
Attachment #136079 - Flags: review?(dbaron)
Attachment #136079 - Flags: review+
Comment on attachment 136079 [details] [diff] [review]
lazily create mMiniFont

Requesting 1.6b approval.   This is an easy performance win for xft builds.
Attachment #136079 - Flags: approval1.6b?
Comment on attachment 136079 [details] [diff] [review]
lazily create mMiniFont

a=asa (on behalf of drivers) for checkin to 1.6 beta.
Attachment #136079 - Flags: approval1.6b? → approval1.6b+
checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: