Closed Bug 397734 Opened 17 years ago Closed 17 years ago

Reduce memory usage for storing glyph extents

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: roc, Assigned: roc)

References

Details

(Keywords: memory-footprint, regression)

Attachments

(1 file)

Attached patch fixSplinter Review
See bug 96041. This bug is for dealing with the space regression. There are two parts to the patch:

1) Resurrect NEED_BOUNDING_BOX flag so that only text frames and SVG request bounding boxes and hence trigger glyph extents acquisition.

2) Optimize storage of widths for simple glyphs. We use an array of pointers to arrays of PRUint16, with an encoding optimization for blocks that contain just a single glyph's width.

There's also some useful DEBUG-only metering code here.
Attachment #282510 - Flags: review?(vladimir)
Attachment #282510 - Flags: approval1.9? → approval1.9+
checked in. let's watch Talos
Looks like this fixed the memory problems, but it caused a regression related to tooltips or something, so I backed it out.
Nothing more than a tragic failure to initialize newBlock:

        newBlock = new PRUint16[BLOCK_SIZE];
        if (!newBlock)
            return;
        newBlock[GetGlyphOffset(bits)] = GetWidth(bits);

I'm adding this and relanding:

        PRUint32 i;
        for (i = 0; i < BLOCK_SIZE; ++i) {
            newBlock[i] = INVALID_WIDTH;
        }
Comment on attachment 282510 [details] [diff] [review]
fix

>+    enum { BLOCK_SIZE_BITS = 7, BLOCK_SIZE = 1 << BLOCK_SIZE_BITS }; // 128-glyph blocks
>+
>+    class GlyphWidths {
Nit: the above enum is never used outside this class...
Flags: blocking1.9? → blocking1.9+
I relanded this already.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: