[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Some diffs to optimize drawing
From: |
Alexander Malmberg |
Subject: |
Re: Some diffs to optimize drawing |
Date: |
Mon, 03 Feb 2003 01:30:02 +0100 |
Nicola Pero wrote:
[snip]
> Well - I suppose the idea would be that the clipping rect can be avoided
> in *most* cases - in most cases (as you note below) the text is drawn by a
> cell, and it's fully visible.
>
> The string drawing code could use clipping *only if* it detects that any
> glyph to draw might (partially or entirely) fall outside the given
> rect. Then, it clips to prevent boundary glyphs from falling partially
> out. But in all other cases - which is in most cases - it could avoid
> clipping completely.
This is true. I didn't think about trying to avoid the clipping, but the
total used rect for the text is available, so the clipping (and what I
assume to be the really expensive part, the gstate save and restore)
could be avoided if the used rect is contained in the drawing rect.
(This is slightly unsafe; the used rect isn't a bounding rect for the
glyphs, but it would take some fairly rare attributes to cause it to
fail.)
- Alexander Malmberg