From bb7e2e846cc9eb963a6d6101849952a8e5d770f7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 25 Feb 2000 14:59:46 +0000 Subject: fixed front/back buffer stride problem for XF86DRI --- src/mesa/drivers/glide/fxdd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 6fd6a1e69e..bc1e55a5ff 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -446,8 +446,13 @@ static GLboolean fxDDDrawBitMap(GLcontext *ctx, GLint px, GLint py, { const GLint winX = fxMesa->x_offset; const GLint winY = fxMesa->y_offset + fxMesa->height - 1; + /* The dest stride depends on the hardware and whether we're drawing + * to the front or back buffer. This compile-time test seems to do + * the job for now. + */ #ifdef XF86DRI - const GLint dstStride = fxMesa->screen_width; + const GLint dstStride = (fxMesa->glCtx->Color.DrawBuffer == GL_FRONT) + ? (fxMesa->screen_width) : (info.strideInBytes / 2); #else const GLint dstStride = info.strideInBytes / 2; /* stride in GLushorts */ #endif -- cgit v1.2.3