aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/swrast/s_stencil.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-01-25 08:32:49 +0100
committermarha <marha@users.sourceforge.net>2012-01-25 08:32:49 +0100
commit0c1cee47049afdcf74d87a23f4f4fd57867f6798 (patch)
tree14c117114d1b996e5b04e6546b1580ea53bc26f2 /mesalib/src/mesa/swrast/s_stencil.c
parent5be921907008288d6465962063bc10fd7a5b1906 (diff)
parente6432710d8a586386b3c7025e845cf4f80830da3 (diff)
downloadvcxsrv-0c1cee47049afdcf74d87a23f4f4fd57867f6798.tar.gz
vcxsrv-0c1cee47049afdcf74d87a23f4f4fd57867f6798.tar.bz2
vcxsrv-0c1cee47049afdcf74d87a23f4f4fd57867f6798.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/swrast/s_stencil.c')
-rw-r--r--mesalib/src/mesa/swrast/s_stencil.c11
1 files changed, 7 insertions, 4 deletions
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);
}
}
}