Re: XForms: Redrawing free objects

Steve Lamont (
Mon, 20 Oct 97 10:30:55 PDT

To subscribers of the xforms list from (Steve Lamont) :

> Steve Lamont wrote:
> > The technique I use is to create an offscreen Pixmap and then use
> > XCopyArea() to blat the Pixmap to the form.
> Is that faster ?

Faster than writing an XImage? Yes, most certainly, since the Pixmap
copy is handled entirely in the server rather than copying bits from
the application to the server over the X connection. If there's any
hardware BITBLT assist, that's where you're going to get most of it.

About the only way I can see that using XPutImage() might be as fast
is if you use the shared memory extensions to X (XShmPutImage(),
etc.). This will work fine if your application is running on the same
piece of hardware as the server but, of course, it will not work at
all if the OS or your relase of X don't support shared memory or XShm,
respectively, or if the client and the server are running on two
different machines. In this case, the only thing you can do is to
test for these conditions and be prepared to deal with them or abort
the application.

Of course, if your image is changing, as with some sort of interactive
animation, you probably aren't going to win too much with XCopyArea()
over XPutImage() (and, in fact, might lose a tad of performance
except in dealing with Expose events where the scene hasn't changed).

> Do you hvave any knowledge about drawingperformance in free-objects?

I don't have any performance figures but I use XCopyArea extensively
in my HTML-subset browser where scrolling Pixmaps look fine with
virtually no flicker or slowing, even on some of my doggy slow old Sun
4s. XForms also uses XCopyArea to handle Pixmaps, BTW.

Refer to your favorite Xlib reference for discussion of XPutImage,
XCreatePixmap, and XCopyArea().

For information on XShm, there should be some docs somewhere in the
X11 distribution -- I forget exactly where but I don't recall having
any difficulty finding them.

To unsubscribe, send the message "unsubscribe" to or see
Xforms Home Page:
List Archive: