Morphic redraws completely hidden objects.

Andreas Raab andreas.raab at gmx.de
Tue Aug 5 18:42:17 UTC 2003


> I was looking at how Morphic did drawing a week back and noticed  
> something odd. If you bring up Tetris and start a game, then cover
> the tetris board with some other mophic object why the Tetris
> player objects are updated even if they are invisible  
> (completely hidden). In this case Morphic redraws the
> foreground object.

Yes.

> Although there is no visual indication of this, I'd expect 
> the resource consumption for doing the drawing in time &
> cpu time isn't minimal. Or is it smaller than the  
> time needed to figure out if a redraw should happen?
> Thus someone might want to look at why completely hidden objects
> get redrawn.

The reason it's redrawing these objects is because they get invalidated and
we spend no time whatsoever trying to cull the invalidated areas. The
question of whether culling the area would be faster than redrawing it can't
be easily answered as it depends on many factors. Depending on the amount of
overlap you have, depending on the whether you have split up invalidated
regions, depending on the amount of objects you see on the screen it can be
faster either way. There is no "best" way to handle this problem unless you
have an extremely efficient region encoding and containment test for
invalidated areas.

Note that most windowing systems deal with this problem only at the level of
a "window" (e.g., top-level objects in the environment) but fail badly for
"interiors". Given the typical use of windows (windows do overlap, but the
contents almost never does) this is exactly right but in Squeak it's not
quite as clear which way to go.

> PS Apple has a nice tool to expose window drawing activity in the  
> Quartz layer which exposed this issue.

So has Squeak - just turning on the #debugDrawDamage preference will show
all of the areas quite nicely.

Cheers,
  - Andreas



More information about the Squeak-dev mailing list