Comment 40 for bug 345207

Revision history for this message
In , longsonr (longsonr) wrote :

(In reply to comment #20)
> >- gfxPoint mPosition;
> >+ gfxPoint mPosition; // character position of first glyph, includes baseline offset
> >+ nsAutoArrayPtr<gfxPoint> mCharPositions; // character position of each glyph,
> >+ // valid if not a simple textrun and/or textPath
>

Even better than a property would be not storing the values at all and simply calculating them on the fly. All you really need is the starting point of the first glyph (mPosition) as that may depend on where the previous frame left you and so would be O(N2). Everything else you should be able to calculate using GetParent where necessary. If we find it is unacceptably slow we can always add caching of the positions in later.

This article explains where we were and what we're trying to avoid :-)
http://weblogs.mozillazine.org/roc/archives/2006/02/anatomy_of_bloat.html

I think it should be possible to get rid of everything except the mPosition member variable (although getting rid of the whitespacehandling member belongs in another bug).