summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-12-24 08:54:26 -0700
committerBrian Paul <[email protected]>2011-12-24 08:54:26 -0700
commit95970677b92bef1b24cc83ecfe1759b35426d3d2 (patch)
treea52475335096baa15fe3ade133c30e91b6cc0008 /src
parentfc41473b9f7d1171a2921a825807889b8fcbcaaf (diff)
swrast: replace GetRow() call with _mesa_unpack_ubyte_stencil_row()
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/swrast/s_stencil.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c
index 5f81fe8ec73..aa9ab162576 100644
--- a/src/mesa/swrast/s_stencil.c
+++ b/src/mesa/swrast/s_stencil.c
@@ -26,6 +26,7 @@
#include "main/glheader.h"
#include "main/context.h"
#include "main/imports.h"
+#include "main/format_unpack.h"
#include "s_context.h"
#include "s_depth.h"
@@ -1044,6 +1045,8 @@ void
_swrast_read_stencil_span(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLint n, GLint x, GLint y, GLubyte stencil[])
{
+ GLubyte *src;
+
if (y < 0 || y >= (GLint) rb->Height ||
x + n <= 0 || x >= (GLint) rb->Width) {
/* span is completely outside framebuffer */
@@ -1064,7 +1067,8 @@ _swrast_read_stencil_span(struct gl_context *ctx, struct gl_renderbuffer *rb,
return;
}
- rb->GetRow(ctx, rb, n, x, y, stencil);
+ src = (GLubyte *) rb->Data + y * rb->RowStride +x;
+ _mesa_unpack_ubyte_stencil_row(rb->Format, n, src, stencil);
}