From 1ad7b99925e044f82e635f746c1ef2df77f69ac9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Sep 2005 02:29:50 +0000 Subject: Initial work for GL_EXT_packed_depth_stencil extension. glReadPixels done, glDrawPixels mostly done. --- src/mesa/drivers/x11/xm_dd.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/mesa/drivers/x11/xm_dd.c') diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index e26b54f8e4..0bafad8e12 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -610,9 +610,7 @@ xmesa_DrawPixels_8R8G8B( GLcontext *ctx, int dstY = y; int w = width; int h = height; - int srcX = unpack->SkipPixels; - int srcY = unpack->SkipRows; - int rowLength = unpack->RowLength ? unpack->RowLength : width; + struct gl_pixelstore_attrib clippedUnpack = *unpack; if (unpack->BufferObj->Name) { /* unpack from PBO */ @@ -636,11 +634,14 @@ xmesa_DrawPixels_8R8G8B( GLcontext *ctx, pixels = ADD_POINTERS(buf, pixels); } - if (_mesa_clip_drawpixels(ctx, &dstX, &dstY, &w, &h, &srcX, &srcY)) { + if (_mesa_clip_drawpixels(ctx, &dstX, &dstY, &w, &h, &clippedUnpack)) { /* This is a little tricky since all coordinates up to now have * been in the OpenGL bottom-to-top orientation. X is top-to-bottom * so we have to carefully compute the Y coordinates/addresses here. */ + int srcX = clippedUnpack.SkipPixels; + int srcY = clippedUnpack.SkipRows; + int rowLength = clippedUnpack.RowLength; XMesaImage ximage; MEMSET(&ximage, 0, sizeof(XMesaImage)); ximage.width = width; @@ -715,9 +716,7 @@ xmesa_DrawPixels_5R6G5B( GLcontext *ctx, int dstY = y; int w = width; int h = height; - int srcX = unpack->SkipPixels; - int srcY = unpack->SkipRows; - int rowLength = unpack->RowLength ? unpack->RowLength : width; + struct gl_pixelstore_attrib clippedUnpack = *unpack; if (unpack->BufferObj->Name) { /* unpack from PBO */ @@ -741,11 +740,14 @@ xmesa_DrawPixels_5R6G5B( GLcontext *ctx, pixels = ADD_POINTERS(buf, pixels); } - if (_mesa_clip_drawpixels(ctx, &dstX, &dstY, &w, &h, &srcX, &srcY)) { + if (_mesa_clip_drawpixels(ctx, &dstX, &dstY, &w, &h, &clippedUnpack)) { /* This is a little tricky since all coordinates up to now have * been in the OpenGL bottom-to-top orientation. X is top-to-bottom * so we have to carefully compute the Y coordinates/addresses here. */ + int srcX = clippedUnpack.SkipPixels; + int srcY = clippedUnpack.SkipRows; + int rowLength = clippedUnpack.RowLength; XMesaImage ximage; MEMSET(&ximage, 0, sizeof(XMesaImage)); ximage.width = width; -- cgit v1.2.3