AGAIN: New canvas item "buffer". 
Author Message
 AGAIN: New canvas item "buffer".

Fellow Tclers,

did everybody of you see my canvas patch with the new "buffer" item
on this newsgroup? I have the impression that some of my messages
got lost in the newsfeed. In particular on this one I expected more

So again:  
I've implemented a new canvas item "buffer", which stores
everything below it in the drawing list into a Pixmap,
refreshing from this Pixmap when redrawing items above it
in the display list.

The implementation required quite some changes to the canvas
drawing algorithm and is therefore contained in tkCanvas.c.

To properly distribute dirtyness two new canvas item manager API
functions had to be added, namely Tk_CanvasEventuallyRedrawItem and
Tk_CanvasEventuallyRedrawItemPartially; however, only tkCanvImg.c
from the standard distribution had to be changed to make use of these
new functions instead of Tk_CanvasEventuallyRedraw (which is obsolete,
but retained for backwards-compatibility reasons). Otherwise,
the implementation is completely backwards-compatible even
on the item manager API level: Without buffers, the same callbacks are
called in the same sequence and with the same parameters.

This implementation gives a speed improvement for animations
on top of complex backgrounds such as geographic maps of about
10x under Unix and 3x under Windows.

Usage is quite straigtforward: Just "create buffer" into the display
at the proper place, and voila, it buffers. No options, no

I didn't add any particular tests yet (which I should since the
algorithm trying to minimise redraws upon buffer deletion or, worse,
movement within the display list is quite tricky).

Are you people from Sun planning to incorporate the patch for 8.1?

Jan Nijtmans, would you alternatively like to take this one on board
for the dash-patch?

Sebastian Wangnick

PS: If you can't find the patch back in those comp.lang.tcl archives,
send me a note, and I'll publish it again.

Office: Eurocontrol Maastricht UAC, Horsterweg 11, NL-6191RX Beek,
        Tel: +31-433661370, Fax: ~300
Home:   Lammersdorfer Str. 61, D-52159 Rott, Tel: +49-2471-2301,


GCS/IT d+(-) s:- a C+() U++$ P+ L+ E--- W++(--) N o? K? w++++(---)
!O !M V PS++ PE Y+ PGP?>++ t++ 5-- X- R tv--- b+++ DI? D--(+) G
e+++ h>---- r+++ y++>*

Fri, 19 May 2000 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. New canvas item "buffer"

2. New canvas item "buffer" (long)

3. new "b" buffer output

4. "copy" and drag a canvas item: strange "current" item

5. ANNOUNCE: new "plus"- and "dash"-patches available for Tcl7.5a2/Tk4.1a2

6. string.join(["Tk 4.2p2", "Python 1.4", "Win32", "free"], "for")

7. How to move a canvas item from C-Code (another new item)

8. CD 3.1 "Buffer Overflow" in report

9. Sending text to the "paste buffer"

10. Use of "buffer" type ports

11. NameError on "buffer"?

12. can't read "expect_out(buffer)": no such variable


Powered by phpBB® Forum Software