gnustep-dev
[Top][All Lists]
Advanced

[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 00:20:03 +0100

Nicola Pero wrote:
[snip]
> Regarding clipping text in cells - I remember what you say - discussing
> this issue - years ago - and instead of fixing the text system to only
> draw in the given rect, hacking it inefficiently by clipping the drawing
> in the cell.  The hack is still there, but hidden down there in the system
> - we've moved it inside the string drawing code itself, it's no longer in
> the cell.  The string drawing code, when given a rect to draw, actually
> clips drawing to the rect, then forgets about it and inefficiently draws
> the whole string, even parts of the string which extend outside the rect.
> 
> Fixing this issue is still an open task! :-)
> 
> But thanks for reminding us - maybe Alexander, in his text system
> rewriting/upgrade, is interested in looking at that too ? :-)

I've already looked at it. :) (I'm using a patched NSStringDrawing based
on the new text system, and noted this when rewriting it.)

The clipping rect can't be avoided. The text system can only draw whole
glyphs, so glyphs partially inside the rect have to be handled by the
clipping rect.

There is still some speed to be gained by only drawing glyphs that might
be inside the rect. There are methods for this, and NSTextView uses
them, but I haven't done that in NSStringDrawing. I don't think it's a
big performance hit, though. As far as I know, the only text that should
pass through NSStringDrawing is text from cells, and that's mostly
completely visible one line labels.

- Alexander Malmberg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]