#include "main/formats.h"
#include "main/framebuffer.h"
#include "main/renderbuffer.h"
+#include "swrast/s_renderbuffer.h"
#define XMESA_RENDERBUFFER 0x1234
struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb);
/* just clear these to be sure we don't accidentally use them */
- xrb->origin1 = NULL;
xrb->origin2 = NULL;
xrb->origin3 = NULL;
xrb->origin4 = NULL;
/* plus... */
if (xrb->ximage) {
- /* Needed by PIXELADDR1 macro */
- xrb->width1 = xrb->ximage->bytes_per_line;
- xrb->origin1 = (GLubyte *) xrb->ximage->data + xrb->width1 * (height - 1);
-
/* Needed by PIXELADDR2 macro */
xrb->width2 = xrb->ximage->bytes_per_line / 2;
xrb->origin2 = (GLushort *) xrb->ximage->data + xrb->width2 * (height - 1);
}
else {
/* out of memory or buffer size is 0 x 0 */
- xrb->width1 = xrb->width2 = xrb->width3 = xrb->width4 = 0;
- xrb->origin1 = NULL;
+ xrb->width2 = xrb->width3 = xrb->width4 = 0;
xrb->origin2 = NULL;
xrb->origin3 = NULL;
xrb->origin4 = NULL;
/* This will really only happen for pixmaps. We'll access the
* pixmap via a temporary XImage which will be 32bpp.
*/
- xrb->Base.Format = MESA_FORMAT_ARGB8888;
+ xrb->Base.Format = MESA_FORMAT_XRGB8888;
break;
case PF_8A8R8G8B:
xrb->Base.Format = MESA_FORMAT_ARGB8888;
}
if (b->backxrb->pixmap) {
XMesaFreePixmap( b->display, b->backxrb->pixmap );
- if (b->xm_visual->hpcr_clear_flag) {
- XMesaFreePixmap( b->display,
- b->xm_visual->hpcr_clear_pixmap );
- XMesaDestroyImage( b->xm_visual->hpcr_clear_ximage );
- }
}
}
return;
}
- if (xrb->Base.Format == MESA_FORMAT_ARGB8888 ||
- xrb->Base.Format == MESA_FORMAT_RGBA8888_REV) {
- /* The original pixmap is RGB but we're returning an RGBA
- * image buffer. Fill in the A values with 0xff.
- */
- GLuint i, *p = (GLuint *) ximage->data;
- for (i = 0; i < w * h; i++) {
- p[i] |= 0xff000000;
- }
- }
-
xrb->map_ximage = ximage;
/* the first row of the OpenGL image is last row of the XImage */
}
/* otherwise, this is an ordinary malloc-based renderbuffer */
- _mesa_map_soft_renderbuffer(ctx, rb, x, y, w, h, mode,
- mapOut, rowStrideOut);
+ _swrast_map_soft_renderbuffer(ctx, rb, x, y, w, h, mode,
+ mapOut, rowStrideOut);
}
}
/* otherwise, this is an ordinary malloc-based renderbuffer */
- _mesa_unmap_soft_renderbuffer(ctx, rb);
+ _swrast_unmap_soft_renderbuffer(ctx, rb);
}