Re: Double buffer widget drawing

On Tue, Oct 19, 1999 at 02:27:55PM +0300, Alexander Piskunov wrote:
> > gtk_begin_paint would allocate a Pixmap for the expose region, all
> > draw operations would go there and gtk_end_paint would only Copy the
> > pixmap to the window.
> Cool! This is a feature i'm waiting for! Double buffer drawing will
> completely change appearance and performance of GTK+. Thanks for responce 
> Miguel. By the way Enlightenment also have this problem (non flicker-free
> widget drawing). Perhaps I should contact Rasterman too;)

allocating a Pixmap is rather expensive on most X servers, perhaps a pixmap
cache based on size should be used, note that any pixmap of equal or
greater size will do, heck, if you dont care about concurency you could
just allocate one big pixmap and re-use it always, just make sure no two
flows of control can be in the critical region at once.  for every window
on the screen just have a backup pixmap of the same size as the window and
call the paint routines pointing to that pixmap instead of the window, this
also has the advantage that you can use the pixmap to handle expose events
trivially without a widget redraw and the code need not be modified to turn
the feature on or off...  remember quite a few X servers have pitiful
Pixmap storage capacity and depending on what hardware acceleration they
have the old method 'might' be preferable. all the adavantages of
backing-store (flicker-free expose)plus on widget updates you get flicker
free action. nice.


John Meacham
California Institute of Technology, Student.

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