diff options
author | marha <marha@users.sourceforge.net> | 2011-12-25 17:34:25 +0100 |
---|---|---|
committer | Marc Haesen <marc@hc-consult.be> | 2011-12-25 17:34:25 +0100 |
commit | 7fd4689bd7bac15dcc0ab13d4689a11e2c303681 (patch) | |
tree | c5bd75a1fc913dcb08d03525d87638e66fa8aad2 /mesalib/src/mesa/drivers/windows | |
parent | 1a9e93b01e2339579bf9a0fae0db0f83b653aab7 (diff) | |
parent | 0fd2d56b0fc0ce74c5f3e5e23cb26b0d1a075ba1 (diff) | |
download | vcxsrv-7fd4689bd7bac15dcc0ab13d4689a11e2c303681.tar.gz vcxsrv-7fd4689bd7bac15dcc0ab13d4689a11e2c303681.tar.bz2 vcxsrv-7fd4689bd7bac15dcc0ab13d4689a11e2c303681.zip |
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/drivers/windows')
-rw-r--r-- | mesalib/src/mesa/drivers/windows/gdi/wmesa.c | 336 |
1 files changed, 4 insertions, 332 deletions
diff --git a/mesalib/src/mesa/drivers/windows/gdi/wmesa.c b/mesalib/src/mesa/drivers/windows/gdi/wmesa.c index 675ffdaaa..255d811ca 100644 --- a/mesalib/src/mesa/drivers/windows/gdi/wmesa.c +++ b/mesalib/src/mesa/drivers/windows/gdi/wmesa.c @@ -526,61 +526,6 @@ static void write_rgba_span_front(struct gl_context *ctx, } } -/* Write a horizontal span of RGB color pixels with a boolean mask. */ -static void write_rgb_span_front(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const void *values, - const GLubyte *mask) -{ - const GLubyte (*rgb)[3] = (const GLubyte (*)[3])values; - WMesaContext pwc = wmesa_context(ctx); - GLuint i; - - (void) ctx; - y=FLIP(y); - if (mask) { - for (i=0; i<n; i++) - if (mask[i]) - SetPixel(pwc->hDC, x+i, y, RGB(rgb[i][RCOMP], rgb[i][GCOMP], - rgb[i][BCOMP])); - } - else { - for (i=0; i<n; i++) - SetPixel(pwc->hDC, x+i, y, RGB(rgb[i][RCOMP], rgb[i][GCOMP], - rgb[i][BCOMP])); - } - -} - -/* - * Write a horizontal span of pixels with a boolean mask. The current color - * is used for all pixels. - */ -static void write_mono_rgba_span_front(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const void *value, - const GLubyte *mask) -{ - const GLchan *color = (const GLchan *)value; - GLuint i; - WMesaContext pwc = wmesa_context(ctx); - COLORREF colorref; - - (void) ctx; - colorref = RGB(color[RCOMP], color[GCOMP], color[BCOMP]); - y=FLIP(y); - if (mask) { - for (i=0; i<n; i++) - if (mask[i]) - SetPixel(pwc->hDC, x+i, y, colorref); - } - else - for (i=0; i<n; i++) - SetPixel(pwc->hDC, x+i, y, colorref); - -} /* Write an array of RGBA pixels with a boolean mask. */ static void write_rgba_pixels_front(struct gl_context *ctx, @@ -603,28 +548,6 @@ static void write_rgba_pixels_front(struct gl_context *ctx, -/* - * Write an array of pixels with a boolean mask. The current color - * is used for all pixels. - */ -static void write_mono_rgba_pixels_front(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, - const GLint x[], const GLint y[], - const void *value, - const GLubyte *mask) -{ - const GLchan *color = (const GLchan *)value; - GLuint i; - WMesaContext pwc = wmesa_context(ctx); - COLORREF colorref; - (void) ctx; - colorref = RGB(color[RCOMP], color[GCOMP], color[BCOMP]); - for (i=0; i<n; i++) - if (mask[i]) - SetPixel(pwc->hDC, x[i], FLIP(y[i]), colorref); -} - /* Read a horizontal span of color pixels. */ static void read_rgba_span_front(struct gl_context *ctx, struct gl_renderbuffer *rb, @@ -706,64 +629,6 @@ static void write_rgba_span_32(struct gl_context *ctx, } -/* Write a horizontal span of RGB color pixels with a boolean mask. */ -static void write_rgb_span_32(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const void *values, - const GLubyte *mask) -{ - const GLubyte (*rgb)[3] = (const GLubyte (*)[3])values; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - GLuint i; - LPDWORD lpdw; - - (void) ctx; - - y=FLIP(y); - lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x; - if (mask) { - for (i=0; i<n; i++) - if (mask[i]) - lpdw[i] = BGR32(rgb[i][RCOMP], rgb[i][GCOMP], - rgb[i][BCOMP]); - } - else { - for (i=0; i<n; i++) - *lpdw++ = BGR32(rgb[i][RCOMP], rgb[i][GCOMP], - rgb[i][BCOMP]); - } -} - -/* - * Write a horizontal span of pixels with a boolean mask. The current color - * is used for all pixels. - */ -static void write_mono_rgba_span_32(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const void *value, - const GLubyte *mask) -{ - const GLchan *color = (const GLchan *)value; - LPDWORD lpdw; - DWORD pixel; - GLuint i; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x; - y=FLIP(y); - pixel = BGR32(color[RCOMP], color[GCOMP], color[BCOMP]); - if (mask) { - for (i=0; i<n; i++) - if (mask[i]) - lpdw[i] = pixel; - } - else - for (i=0; i<n; i++) - *lpdw++ = pixel; - -} - /* Write an array of RGBA pixels with a boolean mask. */ static void write_rgba_pixels_32(struct gl_context *ctx, struct gl_renderbuffer *rb, @@ -780,25 +645,6 @@ static void write_rgba_pixels_32(struct gl_context *ctx, rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]); } -/* - * Write an array of pixels with a boolean mask. The current color - * is used for all pixels. - */ -static void write_mono_rgba_pixels_32(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, - const GLint x[], const GLint y[], - const void *value, - const GLubyte *mask) -{ - const GLchan *color = (const GLchan *)value; - GLuint i; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - for (i=0; i<n; i++) - if (mask[i]) - WMSETPIXEL32(pwfb, FLIP(y[i]),x[i],color[RCOMP], - color[GCOMP], color[BCOMP]); -} /* Read a horizontal span of color pixels. */ static void read_rgba_span_32(struct gl_context *ctx, @@ -892,71 +738,6 @@ static void write_rgba_span_24(struct gl_context *ctx, } -/* Write a horizontal span of RGB color pixels with a boolean mask. */ -static void write_rgb_span_24(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const void *values, - const GLubyte *mask) -{ - const GLubyte (*rgb)[3] = (const GLubyte (*)[3])values; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - GLuint i; - LPBYTE lpb; - - (void) ctx; - - y=FLIP(y); - lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x); - if (mask) { - for (i=0; i<n; i++) - if (mask[i]) { - lpb[3*i] = rgb[i][BCOMP]; - lpb[3*i+1] = rgb[i][GCOMP]; - lpb[3*i+2] = rgb[i][RCOMP]; - } - } - else { - for (i=0; i<n; i++) { - *lpb++ = rgb[i][BCOMP]; - *lpb++ = rgb[i][GCOMP]; - *lpb++ = rgb[i][RCOMP]; - } - } -} - -/* - * Write a horizontal span of pixels with a boolean mask. The current color - * is used for all pixels. - */ -static void write_mono_rgba_span_24(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const void *value, - const GLubyte *mask) -{ - const GLchan *color = (const GLchan *)value; - LPBYTE lpb; - GLuint i; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x); - y=FLIP(y); - if (mask) { - for (i=0; i<n; i++) - if (mask[i]) { - lpb[3*i] = color[BCOMP]; - lpb[3*i+1] = color[GCOMP]; - lpb[3*i+2] = color[RCOMP]; - } - } - else - for (i=0; i<n; i++) { - *lpb++ = color[BCOMP]; - *lpb++ = color[GCOMP]; - *lpb++ = color[RCOMP]; - } -} - /* Write an array of RGBA pixels with a boolean mask. */ static void write_rgba_pixels_24(struct gl_context *ctx, struct gl_renderbuffer *rb, @@ -973,25 +754,6 @@ static void write_rgba_pixels_24(struct gl_context *ctx, rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]); } -/* - * Write an array of pixels with a boolean mask. The current color - * is used for all pixels. - */ -static void write_mono_rgba_pixels_24(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, - const GLint x[], const GLint y[], - const void *value, - const GLubyte *mask) -{ - const GLchan *color = (const GLchan *)value; - GLuint i; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - for (i=0; i<n; i++) - if (mask[i]) - WMSETPIXEL24(pwfb, FLIP(y[i]),x[i],color[RCOMP], - color[GCOMP], color[BCOMP]); -} /* Read a horizontal span of color pixels. */ static void read_rgba_span_24(struct gl_context *ctx, @@ -1077,64 +839,6 @@ static void write_rgba_span_16(struct gl_context *ctx, } -/* Write a horizontal span of RGB color pixels with a boolean mask. */ -static void write_rgb_span_16(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const void *values, - const GLubyte *mask) -{ - const GLubyte (*rgb)[3] = (const GLubyte (*)[3])values; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - GLuint i; - LPWORD lpw; - - (void) ctx; - - y=FLIP(y); - lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x; - if (mask) { - for (i=0; i<n; i++) - if (mask[i]) - lpw[i] = BGR16(rgb[i][RCOMP], rgb[i][GCOMP], - rgb[i][BCOMP]); - } - else { - for (i=0; i<n; i++) - *lpw++ = BGR16(rgb[i][RCOMP], rgb[i][GCOMP], - rgb[i][BCOMP]); - } -} - -/* - * Write a horizontal span of pixels with a boolean mask. The current color - * is used for all pixels. - */ -static void write_mono_rgba_span_16(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const void *value, - const GLubyte *mask) -{ - const GLchan *color = (const GLchan *)value; - LPWORD lpw; - WORD pixel; - GLuint i; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - (void) ctx; - lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x; - y=FLIP(y); - pixel = BGR16(color[RCOMP], color[GCOMP], color[BCOMP]); - if (mask) { - for (i=0; i<n; i++) - if (mask[i]) - lpw[i] = pixel; - } - else - for (i=0; i<n; i++) - *lpw++ = pixel; - -} /* Write an array of RGBA pixels with a boolean mask. */ static void write_rgba_pixels_16(struct gl_context *ctx, @@ -1153,26 +857,6 @@ static void write_rgba_pixels_16(struct gl_context *ctx, rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]); } -/* - * Write an array of pixels with a boolean mask. The current color - * is used for all pixels. - */ -static void write_mono_rgba_pixels_16(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint n, - const GLint x[], const GLint y[], - const void *value, - const GLubyte *mask) -{ - const GLchan *color = (const GLchan *)value; - GLuint i; - WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); - (void) ctx; - for (i=0; i<n; i++) - if (mask[i]) - WMSETPIXEL16(pwfb, FLIP(y[i]),x[i],color[RCOMP], - color[GCOMP], color[BCOMP]); -} /* Read a horizontal span of color pixels. */ static void read_rgba_span_16(struct gl_context *ctx, @@ -1270,10 +954,7 @@ wmesa_set_renderbuffer_funcs(struct gl_renderbuffer *rb, int pixelformat, switch(pixelformat) { case PF_5R6G5B: rb->PutRow = write_rgba_span_16; - rb->PutRowRGB = write_rgb_span_16; - rb->PutMonoRow = write_mono_rgba_span_16; rb->PutValues = write_rgba_pixels_16; - rb->PutMonoValues = write_mono_rgba_pixels_16; rb->GetRow = read_rgba_span_16; rb->GetValues = read_rgba_pixels_16; break; @@ -1281,22 +962,16 @@ wmesa_set_renderbuffer_funcs(struct gl_renderbuffer *rb, int pixelformat, if (cColorBits == 24) { rb->PutRow = write_rgba_span_24; - rb->PutRowRGB = write_rgb_span_24; - rb->PutMonoRow = write_mono_rgba_span_24; rb->PutValues = write_rgba_pixels_24; - rb->PutMonoValues = write_mono_rgba_pixels_24; rb->GetRow = read_rgba_span_24; rb->GetValues = read_rgba_pixels_24; } else { - rb->PutRow = write_rgba_span_32; - rb->PutRowRGB = write_rgb_span_32; - rb->PutMonoRow = write_mono_rgba_span_32; - rb->PutValues = write_rgba_pixels_32; - rb->PutMonoValues = write_mono_rgba_pixels_32; - rb->GetRow = read_rgba_span_32; - rb->GetValues = read_rgba_pixels_32; + rb->PutRow = write_rgba_span_32; + rb->PutValues = write_rgba_pixels_32; + rb->GetRow = read_rgba_span_32; + rb->GetValues = read_rgba_pixels_32; } break; default: @@ -1306,10 +981,7 @@ wmesa_set_renderbuffer_funcs(struct gl_renderbuffer *rb, int pixelformat, else { /* front buffer (actual Windows window) */ rb->PutRow = write_rgba_span_front; - rb->PutRowRGB = write_rgb_span_front; - rb->PutMonoRow = write_mono_rgba_span_front; rb->PutValues = write_rgba_pixels_front; - rb->PutMonoValues = write_mono_rgba_pixels_front; rb->GetRow = read_rgba_span_front; rb->GetValues = read_rgba_pixels_front; } |