(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.
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).
(In reply to comment #20) gfxPoint> mCharPositions; // character position of each glyph,
> >- gfxPoint mPosition;
> >+ gfxPoint mPosition; // character position of first glyph, includes baseline offset
> >+ nsAutoArrayPtr<
> >+ // 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 :-) weblogs. mozillazine. org/roc/ archives/ 2006/02/ anatomy_ of_bloat. html
http://
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).