Xrender cursor performance / double buffering?
dcbw at redhat.com
Tue Apr 17 10:05:11 EDT 2007
On Tue, 2007-04-17 at 12:21 +0200, Bert Freudenberg wrote:
> Hi folks,
> for drag'n'dropping an image between an activity and the sugar frame
> I thought it would be nice to just set it as cursor. This way, it
> gets rendered on top of both the activity and the frame.
Cursors can be hardware accelerated up to a point. See section 126.96.36.199
of the AMD Geode GX2 data book.
> This works nicely on my desktop machine. It also works nicely on the
> XO, as long as there is nothing animating behind the cursor. If there
> is, however, some animation still going while dragging, the
> background and cursor image gets redrawn constantly. Even if the
> cursor is as small as 100x100 pixels this is very visible, apparently
> there is no double-buffering. So, the following is my code to set the
> cursor image - should I do something differently?
> //input: cursorBits (32bit ARGB premul), extentX, extentY,
> offsetX, offsetY
> XImage *image = XCreateImage(stDisplay, DefaultVisual(stDisplay,
> 32, ZPixmap, 0, cursorBits, extentX,
> extentY, 32, 0);
> Pixmap pixmap = XCreatePixmap (stDisplay, DefaultRootWindow
> (stDisplay), extentX, extentY, 32);
> GC gc = XCreateGC(stDisplay, pixmap, 0, 0);
> XPutImage(stDisplay, pixmap, gc, image, 0, 0, 0, 0, extentX,
> image->data = 0; //otherwise, XDestroyImage tries to free this
> XRenderPictFormat *pictformat = XRenderFindStandardFormat
> (stDisplay, PictStandardARGB32);
> Picture picture = XRenderCreatePicture(stDisplay, pixmap,
> pictformat, 0, 0);
> Cursor cursor = XRenderCreateCursor(stDisplay, picture, offsetX,
> XDefineCursor(stDisplay, stWindow, cursor);
> Ideas appreciated - or will the LX make this work magically? This is
> a B2.
> - Bert -
> Devel mailing list
> Devel at laptop.org
More information about the Devel