RenderLayer code

David Hyatt hyatt@apple.com
Fri, 31 Jan 2003 01:26:18 -0800


On Friday, January 31, 2003, at 01:07 AM, Lars Knoll wrote:

> I still don't pass test 4 however (see attached screenshot). I think 
> your code
> flattening the ztree does not honour document order when zindeces are 
> equal.
>

I pass this test.  Something else must be missing...

> At the same time we have a performance problem with the layer code I 
> have to
> look into. Our painting got slower by a factor of about 5 (just 
> estimated).
> I'll check with the new layer code, but one problem might be that you
> construct and flatten the ztree on every paint call.
>

Yes.  The arena allocation helps this (since the ztree nodes get 
recycled).

> Our khtml paints the web page in vertical stripes of 128 pixels (for 
> double
> buffering), so a repaint of the full widget calls paint maybe 5-6 
> times.
> Since this doesn't change very often it would probably be a good idea 
> to
> cache the flattened list.
>

Ack! Yeah, we only do 1 paint call.  Maybe you could somehow grab and 
cache
the list in the case where you know you're going to do multiple 
"striped" paints.

> I thought about adding a RenderLayer *nextToPaint pointer to the layers
> themselves. Like that one would not need an extra list. If a layer gets
> inserted or removed, the paint order can be recalculated, but the 
> paint()
> method should not need to do this.
>

Note that the ztree construction prunes out layers that don't intersect 
your dirty rect, so the list can be different depending on the dirty 
rect.

dave