Timers, Stepping, Co-routines and Riverdance in Squeak

Bob Arning arning at charm.net
Wed Mar 22 02:39:17 UTC 2000


On Tue, 21 Mar 2000 20:20:26 -0500 "David Pennell" <dpennell at quallaby.com> wrote:
>> Now, while I suspect that some time could be saved by ignoring
>> damaged rectangles that were completely offscreen, those results
>> are not too shabby in my view. Are you seeing radically different numbers?
>
>I have a very sparse Morph, like a diagonal line or a hollow polygon that
>occupies a substantial part of the screen.  Can I declare a list of smaller
>dirty rectangles in order to speed up World redraw?

Hi David,

The unqualified answer is... maybe. Each morph that knows it has changed says:
	self invalidRect: self fullBounds
which translates to:
	owner ifNotNil: [owner invalidRect: damageRect].
which ultimately gets to the world which says
	self damageRecorder recordInvalidRect: damageRect
which ends up (in DamageRecorder>>recordInvalidRect:) with:
"Note:  The totalRepaint policy has poor behavior when many local rectangles (such as parts of a text selection) force repaint of the entire screen.  As an alternative, this code performs a simple merge of all rects whenever there are more than 10."

So, if your diagonal morph could present its change as fewer than 10 rectangles (i.e. instead of invalidating your fullBounds, invalidate 2 or 5 or 9 subsections), then you *might* win. The tradeoff is the work involved in keeping track of many individual rectangles vs. the work in redrawing more morphs than are strictly necessary.

Cheers,
Bob





More information about the Squeak-dev mailing list