From e6432710d8a586386b3c7025e845cf4f80830da3 Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 25 Jan 2012 08:24:51 +0100 Subject: mesa git update 25 jan 2012 --- mesalib/src/mesa/swrast/s_stencil.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'mesalib/src/mesa/swrast/s_stencil.c') diff --git a/mesalib/src/mesa/swrast/s_stencil.c b/mesalib/src/mesa/swrast/s_stencil.c index fb95ef14d..bbfbf44cc 100644 --- a/mesalib/src/mesa/swrast/s_stencil.c +++ b/mesalib/src/mesa/swrast/s_stencil.c @@ -292,12 +292,13 @@ get_s8_values(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, const GLint x[], const GLint y[], GLubyte stencil[]) { + struct swrast_renderbuffer *srb = swrast_renderbuffer(rb); const GLint w = rb->Width, h = rb->Height; - const GLubyte *map = (const GLubyte *) rb->Data; + const GLubyte *map = _swrast_pixel_address(rb, 0, 0); GLuint i; if (rb->Format == MESA_FORMAT_S8) { - const GLint rowStride = rb->RowStride; + const GLint rowStride = srb->RowStride; for (i = 0; i < count; i++) { if (x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) { stencil[i] = *(map + y[i] * rowStride + x[i]); @@ -306,7 +307,7 @@ get_s8_values(struct gl_context *ctx, struct gl_renderbuffer *rb, } else { const GLint bpp = _mesa_get_format_bytes(rb->Format); - const GLint rowStride = rb->RowStride * bpp; + const GLint rowStride = srb->RowStride; for (i = 0; i < count; i++) { if (x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) { const GLubyte *src = map + y[i] * rowStride + x[i] * bpp; @@ -326,12 +327,14 @@ put_s8_values(struct gl_context *ctx, struct gl_renderbuffer *rb, const GLubyte stencil[]) { const GLint w = rb->Width, h = rb->Height; + gl_pack_ubyte_stencil_func pack_stencil = + _mesa_get_pack_ubyte_stencil_func(rb->Format); GLuint i; for (i = 0; i < count; i++) { if (x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) { GLubyte *dst = _swrast_pixel_address(rb, x[i], y[i]); - _mesa_pack_ubyte_stencil_row(rb->Format, 1, &stencil[i], dst); + pack_stencil(&stencil[i], dst); } } } -- cgit v1.2.3