From 2e80c7e5bf822e3b9efd145d33badcf4f14504ff Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 16 Jan 2012 11:24:18 -0700 Subject: [PATCH] xlib: remove obsolete GetRow/PutRow code --- src/mesa/drivers/x11/xm_span.c | 1597 +--------------------------------------- 1 file changed, 3 insertions(+), 1594 deletions(-) diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c index 37e88154f49..be4e54563f3 100644 --- a/src/mesa/drivers/x11/xm_span.c +++ b/src/mesa/drivers/x11/xm_span.c @@ -146,1082 +146,6 @@ static unsigned long read_pixel( XMesaDisplay *dpy, -/**********************************************************************/ -/*** Write COLOR SPAN functions ***/ -/**********************************************************************/ - - -#define PUT_ROW_ARGS \ - struct gl_context *ctx, \ - struct gl_renderbuffer *rb, \ - GLuint n, GLint x, GLint y, \ - const void *values, const GLubyte mask[] - -#define RGB_SPAN_ARGS \ - struct gl_context *ctx, \ - struct gl_renderbuffer *rb, \ - GLuint n, GLint x, GLint y, \ - const void *values, const GLubyte mask[] - - -#define GET_XRB(XRB) \ - struct xmesa_renderbuffer *XRB = xmesa_renderbuffer(rb) - - -/* - * Write a span of PF_TRUECOLOR pixels to a pixmap. - */ -static void put_row_TRUECOLOR_pixmap( PUT_ROW_ARGS ) -{ - const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values; - const XMesaContext xmesa = XMESA_CONTEXT(ctx); - GET_XRB(xrb); - XMesaDisplay *dpy = XMESA_BUFFER(ctx->DrawBuffer)->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - register GLuint i; - - y = YFLIP(xrb, y); - if (mask) { - for (i=0;iDrawBuffer)->rowimage; - for (i=0;ixm_visual->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - register GLuint i; - y = YFLIP(xrb, y); - if (mask) { - for (i=0;iDrawBuffer)->rowimage; - for (i=0;ixm_visual->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - register GLuint i; - y = YFLIP(xrb, y); - if (mask) { - for (i=0;iDrawBuffer)->rowimage; - register GLuint *ptr4 = (GLuint *) rowimg->data; - for (i=0;ixm_visual->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - register GLuint i; - y = YFLIP(xrb, y); - if (mask) { - for (i=0;iDrawBuffer)->rowimage; - register GLuint *ptr4 = (GLuint *) rowimg->data; - for (i=0;ixm_visual->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - register GLuint i; - y = YFLIP(xrb, y); - if (mask) { - for (i=0;iDrawBuffer)->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 - } - } - } - else { - /* draw all pixels */ - XMesaImage *rowimg = XMESA_BUFFER(ctx->DrawBuffer)->rowimage; - register GLuint *ptr4 = (GLuint *) rowimg->data; - for (i=0;ixm_visual->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - y = YFLIP(xrb, y); - if (mask) { - register GLuint i; - for (i=0;iDrawBuffer)->rowimage; - register GLuint *ptr4 = (GLuint *) rowimg->data; - register GLuint pixel; - static const GLuint shift[4] = {0, 8, 16, 24}; - register GLuint i = 0; - int w = n; - while (w > 3) { - pixel = rgba[i][BCOMP] /* << shift[0]*/; - pixel |= rgba[i][GCOMP] << shift[1]; - pixel |= rgba[i++][RCOMP] << shift[2]; - pixel |= rgba[i][BCOMP] << shift[3]; - *ptr4++ = pixel; - - pixel = rgba[i][GCOMP] /* << shift[0]*/; - pixel |= rgba[i++][RCOMP] << shift[1]; - pixel |= rgba[i][BCOMP] << shift[2]; - pixel |= rgba[i][GCOMP] << shift[3]; - *ptr4++ = pixel; - - pixel = rgba[i++][RCOMP]/* << shift[0]*/; - pixel |= rgba[i][BCOMP] << shift[1]; - pixel |= rgba[i][GCOMP] << shift[2]; - pixel |= rgba[i++][RCOMP] << shift[3]; - *ptr4++ = pixel; - - w -= 4; - } - switch (w) { - case 3: - pixel = 0; - pixel |= rgba[i][BCOMP] /*<< shift[0]*/; - pixel |= rgba[i][GCOMP] << shift[1]; - pixel |= rgba[i++][RCOMP] << shift[2]; - pixel |= rgba[i][BCOMP] << shift[3]; - *ptr4++ = pixel; - pixel = 0; - pixel |= rgba[i][GCOMP] /*<< shift[0]*/; - pixel |= rgba[i++][RCOMP] << shift[1]; - pixel |= rgba[i][BCOMP] << shift[2]; - pixel |= rgba[i][GCOMP] << shift[3]; - *ptr4++ = pixel; - pixel = 0xffffff00 & *ptr4; - pixel |= rgba[i][RCOMP] /*<< shift[0]*/; - *ptr4 = pixel; - break; - case 2: - pixel = 0; - pixel |= rgba[i][BCOMP] /*<< shift[0]*/; - pixel |= rgba[i][GCOMP] << shift[1]; - pixel |= rgba[i++][RCOMP] << shift[2]; - pixel |= rgba[i][BCOMP] << shift[3]; - *ptr4++ = pixel; - pixel = 0xffff0000 & *ptr4; - pixel |= rgba[i][GCOMP] /*<< shift[0]*/; - pixel |= rgba[i][RCOMP] << shift[1]; - *ptr4 = pixel; - break; - case 1: - pixel = 0xff000000 & *ptr4; - pixel |= rgba[i][BCOMP] /*<< shift[0]*/; - pixel |= rgba[i][GCOMP] << shift[1]; - pixel |= rgba[i][RCOMP] << shift[2]; - *ptr4 = pixel; - break; - case 0: - break; - } - XMesaPutImage( dpy, buffer, gc, rowimg, 0, 0, x, y, n, 1 ); - } -} - - - -/* - * Write a span of PF_5R6G5B pixels to a pixmap. - */ -static void put_row_5R6G5B_pixmap( PUT_ROW_ARGS ) -{ - const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values; - const XMesaContext xmesa = XMESA_CONTEXT(ctx); - GET_XRB(xrb); - XMesaDisplay *dpy = xmesa->xm_visual->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - register GLuint i; - y = YFLIP(xrb, y); - if (mask) { - for (i=0;iDrawBuffer)->rowimage; - register GLushort *ptr2 = (GLushort *) rowimg->data; - for (i=0;ixm_visual->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - register GLuint i; - y = YFLIP(xrb, y); - if (mask) { - for (i=0;iDrawBuffer)->rowimage; - register GLushort *ptr2 = (GLushort *) rowimg->data; - for (i=0;iximage; - register GLuint i; - y = YFLIP(xrb, y); - if (mask) { - for (i=0;iximage; - register GLuint i; - y = YFLIP(xrb, y); - if (mask) { - for (i=0;i 3) { - pixel = rgba[i][BCOMP]; - pixel |= rgba[i][GCOMP] << 8; - pixel |= rgba[i++][RCOMP] << 16; - pixel |= rgba[i][BCOMP] << 24; - *ptr4++ = pixel; - pixel = rgba[i][GCOMP]; - pixel |= rgba[i++][RCOMP] << 8; - pixel |= rgba[i][BCOMP] << 16; - pixel |= rgba[i][GCOMP] << 24; - *ptr4++ = pixel; - pixel = rgba[i++][RCOMP]; - pixel |= rgba[i][BCOMP] << 8; - pixel |= rgba[i][GCOMP] << 16; - pixel |= rgba[i++][RCOMP] << 24; - *ptr4++ = pixel; - w -= 4; - } - switch (w) { - case 0: - break; - case 1: - pixel = *ptr4 & 0xff000000; - pixel |= rgba[i][BCOMP]; - pixel |= rgba[i][GCOMP] << 8; - pixel |= rgba[i][RCOMP] << 16; - *ptr4 = pixel; - break; - case 2: - pixel = rgba[i][BCOMP]; - pixel |= rgba[i][GCOMP] << 8; - pixel |= rgba[i++][RCOMP] << 16; - pixel |= rgba[i][BCOMP] << 24; - *ptr4++ = pixel; - pixel = *ptr4 & 0xffff0000; - pixel |= rgba[i][GCOMP]; - pixel |= rgba[i][RCOMP] << 8; - *ptr4 = pixel; - break; - case 3: - pixel = rgba[i][BCOMP]; - pixel |= rgba[i][GCOMP] << 8; - pixel |= rgba[i++][RCOMP] << 16; - pixel |= rgba[i][BCOMP] << 24; - *ptr4++ = pixel; - pixel = rgba[i][GCOMP]; - pixel |= rgba[i++][RCOMP] << 8; - pixel |= rgba[i][BCOMP] << 16; - pixel |= rgba[i][GCOMP] << 24; - *ptr4++ = pixel; - pixel = *ptr4 & 0xffffff00; - pixel |= rgba[i][RCOMP]; - *ptr4 = pixel; - break; - } - } -} - - -/* - * Write a span of PF_5R6G5B-format pixels to an ximage. - */ -static void put_row_5R6G5B_ximage( PUT_ROW_ARGS ) -{ - const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values; - GET_XRB(xrb); - register GLuint i; - register GLushort *ptr = PIXEL_ADDR2(xrb, x, y); - if (mask) { - for (i=0;ixm_visual->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - register GLuint i; - for (i=0;ixm_visual->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - register GLuint i; - for (i=0;ixm_visual->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - register GLuint i; - for (i=0;ixm_visual->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - register GLuint i; - for (i=0;ixm_visual->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - register GLuint i; - for (i=0;ixm_visual->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - register GLuint i; - for (i=0;ixm_visual->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - register GLuint i; - for (i=0;ixm_visual->display; - XMesaDrawable buffer = xrb->drawable; - XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; - register GLuint i; - for (i=0;iximage; - register GLuint i; - for (i=0;iximage; - register GLuint i; - for (i=0;ir = rgba[i][RCOMP]; - ptr->g = rgba[i][GCOMP]; - ptr->b = rgba[i][BCOMP]; - } - } -} - - -/* - * Write an array of PF_5R6G5B pixels to an ximage. - */ -static void put_values_5R6G5B_ximage( PUT_VALUES_ARGS ) -{ - const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values; - GET_XRB(xrb); - register GLuint i; - for (i=0;ipixmap) { - /* Read from Pixmap or Window */ - XMesaImage *span = NULL; - int error; - int k; - y = YFLIP(xrb, y); - k = clip_for_xgetimage(ctx, xrb->pixmap, &n, &x, &y); - if (k < 0) - return; - rgba += k; - catch_xgetimage_errors( xmesa->display ); - span = XGetImage( xmesa->display, xrb->pixmap, - x, y, n, 1, AllPlanes, ZPixmap ); - error = check_xgetimage_errors(); - if (span && !error) { - switch (xmesa->pixelformat) { - case PF_Truecolor: - case PF_Dither_True: - { - const GLubyte *pixelToR = xmesa->xm_visual->PixelToR; - const GLubyte *pixelToG = xmesa->xm_visual->PixelToG; - const GLubyte *pixelToB = xmesa->xm_visual->PixelToB; - unsigned long rMask = GET_REDMASK(xmesa->xm_visual); - unsigned long gMask = GET_GREENMASK(xmesa->xm_visual); - unsigned long bMask = GET_BLUEMASK(xmesa->xm_visual); - GLint rShift = xmesa->xm_visual->rshift; - GLint gShift = xmesa->xm_visual->gshift; - GLint bShift = xmesa->xm_visual->bshift; - GLuint i; - for (i=0;i> rShift]; - rgba[i][GCOMP] = pixelToG[(p & gMask) >> gShift]; - rgba[i][BCOMP] = pixelToB[(p & bMask) >> bShift]; - rgba[i][ACOMP] = 255; - } - } - break; - case PF_5R6G5B: - case PF_Dither_5R6G5B: - { - const GLubyte *pixelToR = xmesa->xm_visual->PixelToR; - const GLubyte *pixelToG = xmesa->xm_visual->PixelToG; - const GLubyte *pixelToB = xmesa->xm_visual->PixelToB; - GLuint i; - for (i=0;i> 8) & 0xf8); - rgba[i][GCOMP] = ((p >> 3) & 0xfc); - rgba[i][BCOMP] = ((p << 3) & 0xff); - */ - rgba[i][RCOMP] = pixelToR[p >> 11]; - rgba[i][GCOMP] = pixelToG[(p >> 5) & 0x3f]; - rgba[i][BCOMP] = pixelToB[p & 0x1f]; - rgba[i][ACOMP] = 255; - } - } - break; - case PF_8A8B8G8R: - { - const GLuint *ptr4 = (GLuint *) span->data; - GLuint i; - for (i=0;i> 8) & 0xff); - rgba[i][BCOMP] = (GLubyte) ((p4 >> 16) & 0xff); - rgba[i][ACOMP] = (GLubyte) ((p4 >> 24) & 0xff); - } - } - break; - case PF_8A8R8G8B: - { - const GLuint *ptr4 = (GLuint *) span->data; - GLuint i; - for (i=0;i> 16) & 0xff); - rgba[i][GCOMP] = (GLubyte) ((p4 >> 8) & 0xff); - rgba[i][BCOMP] = (GLubyte) ( p4 & 0xff); - rgba[i][ACOMP] = (GLubyte) ((p4 >> 24) & 0xff); - } - } - break; - case PF_8R8G8B: - { - const GLuint *ptr4 = (GLuint *) span->data; - GLuint i; - for (i=0;i> 16) & 0xff); - rgba[i][GCOMP] = (GLubyte) ((p4 >> 8) & 0xff); - rgba[i][BCOMP] = (GLubyte) ( p4 & 0xff); - rgba[i][ACOMP] = 255; - } - } - break; - case PF_8R8G8B24: - { - const bgr_t *ptr3 = (bgr_t *) span->data; - GLuint i; - for (i=0;iximage) { - /* Read from XImage back buffer */ - switch (xmesa->pixelformat) { - case PF_Truecolor: - case PF_Dither_True: - { - const GLubyte *pixelToR = xmesa->xm_visual->PixelToR; - const GLubyte *pixelToG = xmesa->xm_visual->PixelToG; - const GLubyte *pixelToB = xmesa->xm_visual->PixelToB; - unsigned long rMask = GET_REDMASK(xmesa->xm_visual); - unsigned long gMask = GET_GREENMASK(xmesa->xm_visual); - unsigned long bMask = GET_BLUEMASK(xmesa->xm_visual); - GLint rShift = xmesa->xm_visual->rshift; - GLint gShift = xmesa->xm_visual->gshift; - GLint bShift = xmesa->xm_visual->bshift; - XMesaImage *img = xrb->ximage; - GLuint i; - y = YFLIP(xrb, y); - for (i=0;i> rShift]; - rgba[i][GCOMP] = pixelToG[(p & gMask) >> gShift]; - rgba[i][BCOMP] = pixelToB[(p & bMask) >> bShift]; - rgba[i][ACOMP] = 255; - } - } - break; - case PF_5R6G5B: - case PF_Dither_5R6G5B: - { - const GLubyte *pixelToR = xmesa->xm_visual->PixelToR; - const GLubyte *pixelToG = xmesa->xm_visual->PixelToG; - const GLubyte *pixelToB = xmesa->xm_visual->PixelToB; - const GLushort *ptr2 = PIXEL_ADDR2(xrb, x, y); - GLuint i; -#if defined(__i386__) /* word stores don't have to be on 4-byte boundaries */ - const GLuint *ptr4 = (const GLuint *) ptr2; - GLuint extraPixel = (n & 1); - n -= extraPixel; - for (i = 0; i < n; i += 2) { - const GLuint p = *ptr4++; - const GLuint p0 = p & 0xffff; - const GLuint p1 = p >> 16; - /* fast, but not quite accurate - rgba[i][RCOMP] = ((p >> 8) & 0xf8); - rgba[i][GCOMP] = ((p >> 3) & 0xfc); - rgba[i][BCOMP] = ((p << 3) & 0xff); - */ - rgba[i][RCOMP] = pixelToR[p0 >> 11]; - rgba[i][GCOMP] = pixelToG[(p0 >> 5) & 0x3f]; - rgba[i][BCOMP] = pixelToB[p0 & 0x1f]; - rgba[i][ACOMP] = 255; - rgba[i+1][RCOMP] = pixelToR[p1 >> 11]; - rgba[i+1][GCOMP] = pixelToG[(p1 >> 5) & 0x3f]; - rgba[i+1][BCOMP] = pixelToB[p1 & 0x1f]; - rgba[i+1][ACOMP] = 255; - } - if (extraPixel) { - GLushort p = ptr2[n]; - rgba[n][RCOMP] = pixelToR[p >> 11]; - rgba[n][GCOMP] = pixelToG[(p >> 5) & 0x3f]; - rgba[n][BCOMP] = pixelToB[p & 0x1f]; - rgba[n][ACOMP] = 255; - } -#else - for (i = 0; i < n; i++) { - const GLushort p = ptr2[i]; - rgba[i][RCOMP] = pixelToR[p >> 11]; - rgba[i][GCOMP] = pixelToG[(p >> 5) & 0x3f]; - rgba[i][BCOMP] = pixelToB[p & 0x1f]; - rgba[i][ACOMP] = 255; - } -#endif - } - break; - case PF_8A8B8G8R: - { - const GLuint *ptr4 = PIXEL_ADDR4(xrb, x, y); - GLuint i; - for (i=0;i> 8) & 0xff); - rgba[i][BCOMP] = (GLubyte) ((p4 >> 16) & 0xff); - rgba[i][ACOMP] = (GLint) ((p4 >> 24) & 0xff); - } - } - break; - case PF_8A8R8G8B: - { - const GLuint *ptr4 = PIXEL_ADDR4(xrb, x, y); - GLuint i; - for (i=0;i> 16) & 0xff); - rgba[i][GCOMP] = (GLubyte) ((p4 >> 8) & 0xff); - rgba[i][BCOMP] = (GLubyte) ( p4 & 0xff); - rgba[i][ACOMP] = (GLint) ((p4 >> 24) & 0xff); - } - } - break; - case PF_8R8G8B: - { - const GLuint *ptr4 = PIXEL_ADDR4(xrb, x, y); - GLuint i; - for (i=0;i> 16) & 0xff); - rgba[i][GCOMP] = (GLubyte) ((p4 >> 8) & 0xff); - rgba[i][BCOMP] = (GLubyte) ( p4 & 0xff); - rgba[i][ACOMP] = 255; - } - } - break; - case PF_8R8G8B24: - { - const bgr_t *ptr3 = PIXEL_ADDR3(xrb, x, y); - GLuint i; - for (i=0;ixm_visual->display; - register GLuint i; - if (xrb->pixmap) { - XMesaDrawable buffer = xrb->drawable; - switch (xmesa->pixelformat) { - case PF_Truecolor: - case PF_Dither_True: - case PF_5R6G5B: - case PF_Dither_5R6G5B: - { - unsigned long rMask = GET_REDMASK(xmesa->xm_visual); - unsigned long gMask = GET_GREENMASK(xmesa->xm_visual); - unsigned long bMask = GET_BLUEMASK(xmesa->xm_visual); - GLubyte *pixelToR = xmesa->xm_visual->PixelToR; - GLubyte *pixelToG = xmesa->xm_visual->PixelToG; - GLubyte *pixelToB = xmesa->xm_visual->PixelToB; - GLint rShift = xmesa->xm_visual->rshift; - GLint gShift = xmesa->xm_visual->gshift; - GLint bShift = xmesa->xm_visual->bshift; - for (i=0;i> rShift]; - rgba[i][GCOMP] = pixelToG[(p & gMask) >> gShift]; - rgba[i][BCOMP] = pixelToB[(p & bMask) >> bShift]; - rgba[i][ACOMP] = 255; - } - } - break; - case PF_8A8B8G8R: - for (i=0;i> 8) & 0xff); - rgba[i][BCOMP] = (GLubyte) ((p >> 16) & 0xff); - rgba[i][ACOMP] = (GLubyte) ((p >> 24) & 0xff); - } - break; - case PF_8A8R8G8B: - for (i=0;i> 16) & 0xff); - rgba[i][GCOMP] = (GLubyte) ((p >> 8) & 0xff); - rgba[i][BCOMP] = (GLubyte) ( p & 0xff); - rgba[i][ACOMP] = (GLubyte) ((p >> 24) & 0xff); - } - break; - case PF_8R8G8B: - for (i=0;i> 16) & 0xff); - rgba[i][GCOMP] = (GLubyte) ((p >> 8) & 0xff); - rgba[i][BCOMP] = (GLubyte) ( p & 0xff); - rgba[i][ACOMP] = 255; - } - break; - case PF_8R8G8B24: - for (i=0;i> 16) & 0xff); - rgba[i][GCOMP] = (GLubyte) ((p >> 8) & 0xff); - rgba[i][BCOMP] = (GLubyte) ( p & 0xff); - rgba[i][ACOMP] = 255; - } - break; - default: - _mesa_problem(NULL,"Problem in DD.read_color_pixels (1)"); - return; - } - } - else if (xrb->ximage) { - /* Read from XImage back buffer */ - switch (xmesa->pixelformat) { - case PF_Truecolor: - case PF_Dither_True: - case PF_5R6G5B: - case PF_Dither_5R6G5B: - { - unsigned long rMask = GET_REDMASK(xmesa->xm_visual); - unsigned long gMask = GET_GREENMASK(xmesa->xm_visual); - unsigned long bMask = GET_BLUEMASK(xmesa->xm_visual); - GLubyte *pixelToR = xmesa->xm_visual->PixelToR; - GLubyte *pixelToG = xmesa->xm_visual->PixelToG; - GLubyte *pixelToB = xmesa->xm_visual->PixelToB; - GLint rShift = xmesa->xm_visual->rshift; - GLint gShift = xmesa->xm_visual->gshift; - GLint bShift = xmesa->xm_visual->bshift; - XMesaImage *img = xrb->ximage; - for (i=0;i> rShift]; - rgba[i][GCOMP] = pixelToG[(p & gMask) >> gShift]; - rgba[i][BCOMP] = pixelToB[(p & bMask) >> bShift]; - rgba[i][ACOMP] = 255; - } - } - break; - case PF_8A8B8G8R: - for (i=0;i> 8) & 0xff); - rgba[i][BCOMP] = (GLubyte) ((p4 >> 16) & 0xff); - rgba[i][ACOMP] = (GLubyte) ((p4 >> 24) & 0xff); - } - break; - case PF_8A8R8G8B: - for (i=0;i> 16) & 0xff); - rgba[i][GCOMP] = (GLubyte) ((p4 >> 8) & 0xff); - rgba[i][BCOMP] = (GLubyte) ( p4 & 0xff); - rgba[i][ACOMP] = (GLubyte) ((p4 >> 24) & 0xff); - } - break; - case PF_8R8G8B: - for (i=0;i> 16) & 0xff); - rgba[i][GCOMP] = (GLubyte) ((p4 >> 8) & 0xff); - rgba[i][BCOMP] = (GLubyte) ( p4 & 0xff); - rgba[i][ACOMP] = 255; - } - break; - case PF_8R8G8B24: - for (i=0;ir; - rgba[i][GCOMP] = ptr3->g; - rgba[i][BCOMP] = ptr3->b; - rgba[i][ACOMP] = 255; - } - break; - default: - _mesa_problem(NULL,"Problem in DD.read_color_pixels (1)"); - return; - } - } -} /** @@ -1714,97 +214,6 @@ void xmesa_set_renderbuffer_funcs(struct xmesa_renderbuffer *xrb, enum pixel_format pixelformat, GLint depth) { - const GLboolean pixmap = xrb->pixmap ? GL_TRUE : GL_FALSE; - - switch (pixelformat) { - case PF_Truecolor: - if (pixmap) { - xrb->Base.PutRow = put_row_TRUECOLOR_pixmap; - xrb->Base.PutValues = put_values_TRUECOLOR_pixmap; - } - else { - xrb->Base.PutRow = put_row_TRUECOLOR_ximage; - xrb->Base.PutValues = put_values_TRUECOLOR_ximage; - } - break; - case PF_Dither_True: - if (pixmap) { - xrb->Base.PutRow = put_row_TRUEDITHER_pixmap; - xrb->Base.PutValues = put_values_TRUEDITHER_pixmap; - } - else { - xrb->Base.PutRow = put_row_TRUEDITHER_ximage; - xrb->Base.PutValues = put_values_TRUEDITHER_ximage; - } - break; - case PF_8A8B8G8R: - if (pixmap) { - xrb->Base.PutRow = put_row_8A8B8G8R_pixmap; - xrb->Base.PutValues = put_values_8A8B8G8R_pixmap; - } - else { - xrb->Base.PutRow = put_row_8A8B8G8R_ximage; - xrb->Base.PutValues = put_values_8A8B8G8R_ximage; - } - break; - case PF_8A8R8G8B: - if (pixmap) { - xrb->Base.PutRow = put_row_8A8R8G8B_pixmap; - xrb->Base.PutValues = put_values_8A8R8G8B_pixmap; - } - else { - xrb->Base.PutRow = put_row_8A8R8G8B_ximage; - xrb->Base.PutValues = put_values_8A8R8G8B_ximage; - } - break; - case PF_8R8G8B: - if (pixmap) { - xrb->Base.PutRow = put_row_8R8G8B_pixmap; - xrb->Base.PutValues = put_values_8R8G8B_pixmap; - } - else { - xrb->Base.PutRow = put_row_8R8G8B_ximage; - xrb->Base.PutValues = put_values_8R8G8B_ximage; - } - break; - case PF_8R8G8B24: - if (pixmap) { - xrb->Base.PutRow = put_row_8R8G8B24_pixmap; - xrb->Base.PutValues = put_values_8R8G8B24_pixmap; - } - else { - xrb->Base.PutRow = put_row_8R8G8B24_ximage; - xrb->Base.PutValues = put_values_8R8G8B24_ximage; - } - break; - case PF_5R6G5B: - if (pixmap) { - xrb->Base.PutRow = put_row_5R6G5B_pixmap; - xrb->Base.PutValues = put_values_5R6G5B_pixmap; - } - else { - xrb->Base.PutRow = put_row_5R6G5B_ximage; - xrb->Base.PutValues = put_values_5R6G5B_ximage; - } - break; - case PF_Dither_5R6G5B: - if (pixmap) { - xrb->Base.PutRow = put_row_DITHER_5R6G5B_pixmap; - xrb->Base.PutValues = put_values_DITHER_5R6G5B_pixmap; - } - else { - xrb->Base.PutRow = put_row_DITHER_5R6G5B_ximage; - xrb->Base.PutValues = put_values_DITHER_5R6G5B_ximage; - } - break; - default: - _mesa_problem(NULL, "Bad pixel format in xmesa_update_state (1)"); - return; - } - - - /* Get functions */ - xrb->Base.GetRow = get_row_rgba; - xrb->Base.GetValues = get_values_rgba; + /* XXX remove this */ } -- 2.11.0