Re: First pass at double-buffered drawing




Miguel de Icaza <miguel@gnu.org> writes:

> > Since there seems to be a strong interest in the idea
> > of double-bufferingback, I've checked my current working
> > tree into CVS on the branch gtk-no-flicker. 
> 
> Very nice!
> 
> I tried to figure out on my own a few things, please tell me if I am
> correct:
> 
> 	1. The idea is to have as many window-less widgets as possible
>            to take as much advange of the setup.

The techinque works for both window-less and windowed widgets.
Yes, things work a bit better for window-less widgets,
(since you don't temporarily get unexposed areas when
a subwindow is moved) but it does a reasonably good job
on window-widgets as well. I don't see really see changing
widgets over for 1.4,since that would either require changes
in even propagation, or lots of tricky use of input-only
widgets.
 
> 	2. I could not figure out how you do the double buffering.
> 
> 	   I saw you create the backing pixmap.  But say the pixmap is
> 	   not relative to 0,0, but to 10, 10, and you draw a line
> 	   from 0,0 to 20,20 that it actually needs to call XDrawLine
> 	   with -10,-10, 10,10?

Heh, it's a little tricky. In 1.4 every drawable has a vtable.
The vtable for GdkWindow normally passes the event directly
along to the platform-specific vtable, but if a paint is
in effect, then it translates the coordinates and draws onto
the double-buffering pixmap.

Regards,
                                        Owen




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]