diff options
Diffstat (limited to 'src/mesa/drivers/x11')
-rw-r--r-- | src/mesa/drivers/x11/xm_api.c | 3 | ||||
-rw-r--r-- | src/mesa/drivers/x11/xm_span.c | 18 |
2 files changed, 18 insertions, 3 deletions
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 62d30a6987..908fecc85a 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -2410,11 +2410,8 @@ xbuffer_to_renderbuffer(int buffer) case GLX_AUX0_EXT: return BUFFER_AUX0; case GLX_AUX1_EXT: - return BUFFER_AUX1; case GLX_AUX2_EXT: - return BUFFER_AUX2; case GLX_AUX3_EXT: - return BUFFER_AUX3; case GLX_AUX4_EXT: case GLX_AUX5_EXT: case GLX_AUX6_EXT: diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c index 57b5749448..309cefcb8e 100644 --- a/src/mesa/drivers/x11/xm_span.c +++ b/src/mesa/drivers/x11/xm_span.c @@ -471,8 +471,26 @@ static void put_row_8R8G8B_pixmap( PUT_ROW_ARGS ) if (mask) { for (i=0;i<n;i++,x++) { if (mask[i]) { +#if 1 + /* + * XXX Something funny is going on here. + * If we're drawing into a window that uses a depth 32 TrueColor + * visual, we see the right pixels on screen, but when we read + * them back with XGetImage() we get random colors. + * The alternative code below which uses XPutImage() instead + * seems to mostly fix the problem, but not always. + * We don't normally create windows with this visual, but glean + * does and we're seeing some failures there. + */ XMesaSetForeground( dpy, gc, PACK_8R8G8B( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] )); XMesaDrawPoint( dpy, buffer, gc, (int) x, (int) y ); +#else + /* This code works more often, but not always */ + XMesaImage *rowimg = XMESA_BUFFER(ctx->DrawBuffer)->rowimage; + GLuint *ptr4 = (GLuint *) rowimg->data; + *ptr4 = PACK_8R8G8B( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ); + XMesaPutImage( dpy, buffer, gc, rowimg, 0, 0, x, y, 1, 1 ); +#endif } } } |