Gdk, X11, and backing store



I have a question concerned with the lack of backing store in Gdk. I'm
not a big expert on X, but one of the things that I have picked up is
that if when you create a window do:

    unsigned long valuemask;
    XSetWindowAttributes attributes;

    :
    valuemask = CWBackingStore;
    attributes.backing_store = WhenMapped;
    :

    win = XCreateWindow(... , valuemask, &attributes);
    XMapWindow(dpy, win);

you no longer get any exposure events for the window, but the X server
is taking care of the exposure events on its own by using backing_store.

For some reason not totally clear to me, it is much faster to use
backing store than to do the exposure handling yourself by drawing in
a pixmap and just copying it when you get the exposure event. I
suspect that the X-server is using video-memory than is not visible on
the screen, whereas such memory is not available for a user process,
but I might be wrong.

Now my question is why Gdk doesn't provide any facilities for using
backing store? Are there some drawbacks that I'm not aware of? Backing
store provides (at least at my "slow" 166Mhz Pentium with a PCI Cirrus
Logic card) a big perceptive speedup and reduce of flickering and I 
would hate to see Gdk miss this.

Looking at gdkwindow.c it seems to be quite easy to add the
functionality to gdk_window_new by extending GdkWindowAttr with the
field backing_store and defining GDK_BACKING_STORE which is then used
in attributes_mask. The values are then just transfered to their
corresponding X fields. Any objections?

Dov

    
   



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