[cairo] Help required with redraw problems
c99drn at cs.umu.se
Sun Mar 28 02:18:32 PST 2004
On Sat, 2004-03-27 at 22:49 -0700, Charles Tuckey wrote:
> Hi David,
> We are proceeding with integrating the OpenGL backend with our project.
> However, we have run into a problem(s). Note that we are running this on
> a Redhat Enteprise Linux 2.1 machine (XFree 4.1.0).
> For our purpsoses, we cannot use the method
> 'cairo_glx_surface_create_for_window' because we want to draw on to a
> gtk window's backbuffer which is a pixmap. So we created a clone of
> cairo_glx_surface_create_for_window called
> cairo_glx_surface_create_for_pixmap and then
> glc_glx_surface_create_for_pixmap and created a GLXPixmap using a
> glXCreateGLXPixmap() call. On one machine that is running on a VMWare
> virtual machine we can draw on to the pixmap and everything works fine.
> Another machine (a real one) that has NVIDIA card running NVIDIA X
> server and GL implementaion, we get an X error that says:
> The program '<unknown>' received an X Window System error.
> This probably reflects a bug in the program.
> The error was 'BadMatch (invalid parameter attributes)'.
> (Details: serial 588 error_code 8 request_code 129 minor_code 5)
> (Note to programmers: normally, X errors are reported asynchronously;
> that is, you will receive the error a while after causing it.
> To debug your program, run it with the --sync command line
> option to change this behavior. You can then get a meaningful
> backtrace from your debugger if you break on the gdk_x_error()
> We tracked down the error to a line that calls glXMakeCurrent().
> Do you have any idea what may be causing this error? Or any suggestions
> as to what we should be looking at?
I'm sorry to say but I'm pretty sure that rendering to a GLXPixmap will
never give you any hardware acceleration. I don't even think that the
NVIDIA drivers supports it and that's probably why you get that X error
What you could instead try to do is to create a GLC offscreen surface.
Drawing to a GLC offscreen surface is always hardware accelerated but
you'll need to use glc_surface_draw_pixels and glc_surface_read_pixels
to get the pixmap data to and from the surface. The draw_pixels and
read_pixels are fairly slow so if you're not drawing a lot in each frame
this method of drawing to a pixmap might turn out even slower than
without hardware acceleration.
Have you tried using NVIDIA's latest xfree drivers with render
acceleration turned on?
If not, then this would be the first thing you should try. Unless you
use a lot of surface transformations in cairo this would give you a
great performance boost (around x10 faster).
You will need to be running a newer X server, 4.3.0 would do it. And
make sure you get NVIDIA's latest drivers and add:
Option "RenderAccel" "true"
to the driver section of XF86Config.
David Reveman <c99drn at cs.umu.se>
More information about the cairo