summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2004-11-10 15:46:52 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2004-11-10 15:46:52 +0000
commit60909388ab136d849d99eab49e782a53772a618f (patch)
tree84a981ea2e79b5e6477d05991119a23efa4429a5 /src/mesa/drivers/dri
parentf00d7edd746e4d1eec2d497419f21fb3b04f8bd4 (diff)
GL_(UN)PACK_SKIP_IMAGES should only be applied to 3D texture pack/unpacking
and ignored for 1D and 2D images. Need to pass in image dimensions (1,2,3) to the _mesa_image_address() function. This change gets propogated to some other routines. Also added new _mesa_image_address[123]d() convenience functions.
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/r200/r200_swtcl.c4
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_subset_bitmap.c8
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_pixels.c28
3 files changed, 20 insertions, 20 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.c b/src/mesa/drivers/dri/r200/r200_swtcl.c
index 7fb91a0730..43f8365078 100644
--- a/src/mesa/drivers/dri/r200/r200_swtcl.c
+++ b/src/mesa/drivers/dri/r200/r200_swtcl.c
@@ -839,8 +839,8 @@ r200PointsBitmap( GLcontext *ctx, GLint px, GLint py,
*/
for (row=0; row<height; row++) {
const GLubyte *src = (const GLubyte *)
- _mesa_image_address( unpack, bitmap, width, height,
- GL_COLOR_INDEX, GL_BITMAP, 0, row, 0 );
+ _mesa_image_address2d(unpack, bitmap, width, height,
+ GL_COLOR_INDEX, GL_BITMAP, row, 0 );
if (unpack->LsbFirst) {
/* Lsb first */
diff --git a/src/mesa/drivers/dri/radeon/radeon_subset_bitmap.c b/src/mesa/drivers/dri/radeon/radeon_subset_bitmap.c
index cb4a514221..3ac20bd7b7 100644
--- a/src/mesa/drivers/dri/radeon/radeon_subset_bitmap.c
+++ b/src/mesa/drivers/dri/radeon/radeon_subset_bitmap.c
@@ -146,8 +146,8 @@ radeonPointsBitmap( GLsizei width, GLsizei height,
if (ctx->_RotateMode) {
for (col=0; col<width; col++) {
const GLubyte *src = (const GLubyte *)
- _mesa_image_address( unpack, bitmap, height, width,
- GL_COLOR_INDEX, GL_BITMAP, 0, col, 0 );
+ _mesa_image_address2d(unpack, bitmap, height, width,
+ GL_COLOR_INDEX, GL_BITMAP, col, 0 );
/* Msb first */
GLubyte mask = 128U >> (unpack->SkipPixels & 0x7);
@@ -166,8 +166,8 @@ radeonPointsBitmap( GLsizei width, GLsizei height,
else {
for (row=0; row<height; row++) {
const GLubyte *src = (const GLubyte *)
- _mesa_image_address( unpack, bitmap, width, height,
- GL_COLOR_INDEX, GL_BITMAP, 0, row, 0 );
+ _mesa_image_address2d(unpack, bitmap, width, height,
+ GL_COLOR_INDEX, GL_BITMAP, row, 0 );
/* Msb first */
GLubyte mask = 128U >> (unpack->SkipPixels & 0x7);
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c
index aaee401d7a..7ec6302cf1 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c
@@ -264,10 +264,10 @@ tdfx_bitmap_R5G6B5(GLcontext * ctx, GLint px, GLint py,
for (row = 0; row < height; row++) {
const GLubyte *src =
- (const GLubyte *) _mesa_image_address(finalUnpack,
- bitmap, width, height,
- GL_COLOR_INDEX,
- GL_BITMAP, 0, row, 0);
+ (const GLubyte *) _mesa_image_address2d(finalUnpack,
+ bitmap, width, height,
+ GL_COLOR_INDEX,
+ GL_BITMAP, row, 0);
if (finalUnpack->LsbFirst) {
/* least significan bit first */
GLubyte mask = 1U << (finalUnpack->SkipPixels & 0x7);
@@ -423,10 +423,10 @@ tdfx_bitmap_R8G8B8A8(GLcontext * ctx, GLint px, GLint py,
/* compute dest address of bottom-left pixel in bitmap */
for (row = 0; row < height; row++) {
const GLubyte *src =
- (const GLubyte *) _mesa_image_address(finalUnpack,
- bitmap, width, height,
- GL_COLOR_INDEX,
- GL_BITMAP, 0, row, 0);
+ (const GLubyte *) _mesa_image_address2d(finalUnpack,
+ bitmap, width, height,
+ GL_COLOR_INDEX,
+ GL_BITMAP, row, 0);
if (finalUnpack->LsbFirst) {
/* least significan bit first */
GLubyte mask = 1U << (finalUnpack->SkipPixels & 0x7);
@@ -512,8 +512,8 @@ tdfx_readpixels_R5G6B5(GLcontext * ctx, GLint x, GLint y,
GL_FRONT) ? (fxMesa->screen_width) : (info.strideInBytes / 2);
const GLushort *src = (const GLushort *) info.lfbPtr
+ scrY * srcStride + scrX;
- GLubyte *dst = (GLubyte *) _mesa_image_address(packing,
- dstImage, width, height, format, type, 0, 0, 0);
+ GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing,
+ dstImage, width, height, format, type, 0, 0);
const GLint dstStride = _mesa_image_row_stride(packing,
width, format, type);
@@ -573,8 +573,8 @@ tdfx_readpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y,
+ scrY * srcStride + scrX;
const GLint dstStride =
_mesa_image_row_stride(packing, width, format, type);
- GLubyte *dst = (GLubyte *) _mesa_image_address(packing,
- dstImage, width, height, format, type, 0, 0, 0);
+ GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing,
+ dstImage, width, height, format, type, 0, 0);
const GLint widthInBytes = width * 4;
{
@@ -667,8 +667,8 @@ tdfx_drawpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y,
+ scrY * dstStride + scrX * 4;
const GLint srcStride =
_mesa_image_row_stride(unpack, width, format, type);
- const GLubyte *src = (GLubyte *) _mesa_image_address(unpack,
- pixels, width, height, format, type, 0, 0, 0);
+ const GLubyte *src = (GLubyte *) _mesa_image_address2d(unpack,
+ pixels, width, height, format, type, 0, 0);
const GLint widthInBytes = width * 4;
if ((format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8) ||