[comp.sys.amiga.tech] Layers speed

filbo@gorn.santa-cruz.ca.us (Bela Lubkin) (10/27/89)

In article <8779@ardent.UUCP> (comp.sys.amiga) Rob Peck writes:
> The use of SMART_REFRESH does, at times, slow things down, but NOWHERE near
> as much slowdown as when someone uses a GIMMEZEROZERO window.

> a GIMMEZEROZERO window prevents Intuition from rendering its gadgets and
> borders into the superbitmap.  Intuition does this by providing -->5<---
> layers totally, one for the drawable area, one for the top, bottom, left,
> and right edges of the window.  THATS when operations on windows can really
> get bogged down.
Could this alternatively be implemented by TWO layers, one for the drawable
area and one that covers the entire window?  This would waste a bunch of
memory, but might be a good choice for systems with more chip memory than
needed.  Anyone want to write a PD hack that does this?  Ultimately it would
be good as a Preferences type switch, of course.

An even worse hack would be to do the above, then free up the memory for those
parts of the whole-window bitmap that we "know" will never be written to or
displayed.  i.e. allocate a big bitmap, then free up the interior parts of the
center lines.  (I don't know what effect this would have on memory
fragmentation... not good, I'm sure) (figures "A" & "B"):
    +--------------+     +--------------+               +--------------+
    |              |     | +----------+ |  border stuff | +----------+ | fig.
    |              | --> | | freed up |*|  rendered in  |*| CONTENTS | |  C
    |              |     | +----------+ |  "*" areas... | +----------+ |
    +--------------+     +--------------+               +--------------+
        fig. A                fig.                      ^^ ^^^^^^^^^^
                                                        || Layer used by
 Layer into which Intuition is told to render border stuff  applications

WAIT A SEC!  Can we not place the "contents" part in "freed up"?!?  Then the
bitmap for the window looks just like it should.  Layers etc. are purely a
logical thing.  WHY are GZZ windows not implemented as a single bitmap and
two layers?  Will Intuition try to render into the "contents" part of the
window just because the layer says that's part of the window?  Won't it stick
to the border areas like it visually appears to?  (Figure "C").

[Note: I realize that some of the ideas presented above are in the
"horribly bad programming" class.  Programs that do things like this should
ALWAYS perform sanity checks on the system to make sure that the
undocumented conditions that they expect do actually obtain.  Possibly they
should simply refuse to run on later OS versions than they were written
for, or should insist on a command-line affirmation from the user that it
is really OK; then the user would not get blown up that first time with the
new OS, and could test the program at leisure to make sure it is actually
compatible, before adding "COMPATIBLE=1.4" to the command line (note that
this form allows the program to still die for 1.5, 2.0, whatever)].

Bela Lubkin    * *    //  filbo@gorn.santa-cruz.ca.us  CompuServe: 73047,1112
     @       * *     //   ....ucbvax!ucscc!gorn!filbo  ^^^-VERY slow [months]
R Pentomino    *   \X/    Filbo @ Pyrzqxgl +408-476-4633 & XBBS +408-476-4945

usenet@cps3xx.UUCP (Usenet file owner) (10/28/89)

In article <66.filbo@gorn.santa-cruz.ca.us> filbo@gorn.santa-cruz.ca.us (Bela Lubkin) writes:
>In article <8779@ardent.UUCP> (comp.sys.amiga) Rob Peck writes:
>> a GIMMEZEROZERO window prevents Intuition from rendering its gadgets and
>> borders into the superbitmap.  Intuition does this by providing -->5<---

>Could this alternatively be implemented by TWO layers, one for the drawable
>area and one that covers the entire window?  This would waste a bunch of

How about making it be two layers, with the partially obscured
layer being SIMPLE_REFRESH ---> not much wasted mem.

Much better idea -> Make layers be nestable. Then you could do
something like this:

rast=screen.RastPort;

	nw.Raster=rast;
	win1=OpenWindow(&nw);

	nw2.Raster=win1->Raster;
	win2=OpenWindow(&nw2);

This would place win2 inside of win1, much like windows are
now contained in screens.
This would provide GIMMEZEROZERO type windows for free, so to speak.

I suppose the guys at CBM will think this is hard to do or something,
right ? :-)
 Joe Porkka   porkka@frith.egr.msu.edu

jimm@amiga.UUCP (Jim Mackraz) (10/31/89)

)>In article <8779@ardent.UUCP> (comp.sys.amiga) Rob Peck writes:
)>> a GIMMEZEROZERO window prevents Intuition from rendering its gadgets and
)>> borders into the superbitmap.  Intuition does this by providing -->5<---

)In article <66.filbo@gorn.santa-cruz.ca.us> filbo@gorn.santa-cruz.ca.us (Bela Lubkin) writes:

)>Could this alternatively be implemented by TWO layers, one for the drawable
)>area and one that covers the entire window?  This would waste a bunch of

In article <5165@cps3xx.UUCP> porkka@frith.UUCP (Joe Porkka) writes:
)How about making it be two layers, with the partially obscured
)layer being SIMPLE_REFRESH ---> not much wasted mem.

That's right, Joe, this is a more logical way to do G00 windows.
Fortunately, that's how it's implemented.  The overhead is in the
part of layers that manages "dicing", a rectangular decomposition
of the screen area that can represent any layer at any depth
as a union of rectangles.

I don't know where in History Rob picked up the ">5< layers" 
thing, but I've never seen anything of like that in Intuition.
It would be much worse when moving the window.

)Much better idea -> Make layers be nestable. Then you could do
)something like this:
)
)rast=screen.RastPort;
)
)	nw.Raster=rast;
)	win1=OpenWindow(&nw);
)
)	nw2.Raster=win1->Raster;
)	win2=OpenWindow(&nw2);
)
)This would place win2 inside of win1, much like windows are
)now contained in screens.
)This would provide GIMMEZEROZERO type windows for free, so to speak.

Yes, something called "panes."

)I suppose the guys at CBM will think this is hard to do or something,
)right ? :-)

A simple matter of programming ...  Actually, I've found a nice
spot to hook that in, so maybe some day ...

	jimm

-- 
--------------------------------------------------	- opinions by me
"This voice console is a *must*.  I press Execute. 
 `Hello, I know that you've been feeling tired.
  I bring you love and deeper understanding.' "		-lyrics by Kate Bush

rap@peck.ardent.com (Rob Peck) (11/02/89)

In article <4769@amiga.UUCP> jimm@batgirl.UUCP (Jim Mackraz) writes:
>I don't know where in History Rob picked up the ">5< layers" 
>thing, but I've never seen anything of like that in Intuition.
>It would be much worse when moving the window.

RJ told me that one day, as I recall, though it is entirely possible that
he was pulling my leg at the time.  During that period, he was heavily
into the design of Intuition and the Intuition manual was still only
a gleam in his eye. 

Rob

bader+@andrew.cmu.edu (Miles Bader) (11/02/89)

Hey, does 1.4 fix the problem where a window's layers get fragmented by
overlapping windows, but then never ever again get coalesced, even when every
other window on the screen is gone (so you try and move the window, and it
gets done with 4 million little tiny blits)?

[I don't KNOW that this involves "layers" but it sure seems like it would]

Just wondering

-Miles