caching of screen display...

Raab, Andreas Andreas.Raab at disney.com
Thu Dec 2 09:44:48 UTC 1999


> > For example, setting "PasteUpMorph MinCycleLapse: 1000" should reduce
> > network traffic pretty far, too....

Yes, but it has currently bad side effects (such as that Morphs won't step
for this period of time).

> Ok, well I'm still understanding how/where the 
> primitiveDeferDisplayUpdates method is called. (primitive 126)

Look at the senders of Display>>deferUpdates: It's called from
PasteUpMorp>>doDeferredUpdating and can be traced back into
PasteUpMorph>>displayWorld. That's where the magic happens - notice in
particular the #forceToScreen: operations at the end.

> I then tried my deferred updates and got 1754 cached screen updates, and
64
> actual screen updates, which is what I expect, the number is probably very
> close to 60 but I need to drop a stop watch, halt the program read counter
> from debugger, This of course impacts the time reported, but good enough
for
> now. (320 is not close to 64)

The traffic is not only (mainly?!) depending from the number of updates. If
you would count the number of *pixels* that are actually drawn you should
end up with very much the same number. See above, #forceToScreen: is used to
update the display partially so there is no need to make a roundtrip to the
server with the full display bitmap (if that's the case it's a bug). A small
portion does just fine - in fact one could think about forcing the update
immediately after drawing completed which should make drawing and
transmission parallel and thus faster.

> I did note that deferDisplayUpdates if true doesn't invoke the VMs screen
> update, but it also doesn't remember the 'damaged' area. It also doesn't
> trap updates via primitive 127 or the fullDisplayUpdate method. It also
begs
> the question who turns it on, who turns it off, and who refreshes the
> damaged area. I assume this rest with the programmer? He turns it on, does
> lots of screen manipulation, then turns it off and refreshes the screen?
> This is helpful for specific cases but I doubt any programmer will do this
> as a general way of programming.

Again, see PasteUpMorph>>displayWorld. Display updating is deferred for an
entire redraw cycle so there is no need for the average programmer to ever
worry about this. You just go on and draw - Morphic does the rest for you. 

  Andreas





More information about the Squeak-dev mailing list