Squeak DisplayScreen Bitmap Stationary?

Tim Rowledge tim at sumeru.stanford.edu
Mon Aug 19 15:13:35 UTC 2002


Marcel Weiher <marcel at metaobject.com> is claimed by the authorities to have written:

> 
> On Monday, August 19, 2002, at 01:41  Uhr, Ian Piumarta wrote:
> 
> > On Mon, 19 Aug 2002, Marcel Weiher wrote:
> >
> >> will Squeak's DisplayScreen bitmap be moved around during garbage
> >> collection?
> >
> > Yes.
Well, unless you use the technique I came up with for Acorn.
Basically I enforce an _external_ Bitmap object. In
sqRPCWindows.c:ioShowDisplay() I call my SetDisplayBitmap routine which
creates (if there isn't already one around from a previous call) an
Acorn display bitmap and a) copies the pixels there just in case
b) munges the Acorn bitmap to stick the proper Squeak header in there
c) puts the fake-oop for this fake Bitmap in the Display special oop.
et viola!
The Acorn bitmap is _outside_ the object memory and never gets moved.
There is an important little hack to add; 'displayBits' is a priviledged
littel global that also has to be set to the oop of the fake-Bitmap so
it gets treated properly during a GC. It was added several years ago to
support Acorn.

I think you may well find that using the SurfacePlugin can provide the
same general support in a more principled form not to mention with
abilities to hande pixel format conversions. I really must make time to
try it out myslef one day, but you know where the time goes....

tim

-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Luck can't last a lifetime unless you die young




More information about the Squeak-dev mailing list