aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-09-28 21:49:10 -0600
committerBrian Paul <[email protected]>2009-09-28 21:49:10 -0600
commitcb0ef0cbf8116ebb8317b5711e1f119369bdf8f7 (patch)
tree0fccd6d1116a21ff0bd4c1b42d7e26ab5191c343 /src
parentb436d729d1a2aacc13e274883b4dbdd104bdd1ad (diff)
glide: use _mesa_texstore()
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/glide/fxddtex.c83
1 files changed, 35 insertions, 48 deletions
diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c
index 551ddb0fc7f..354015af1d5 100644
--- a/src/mesa/drivers/glide/fxddtex.c
+++ b/src/mesa/drivers/glide/fxddtex.c
@@ -137,18 +137,15 @@ _mesa_halve2x2_teximage2d ( GLcontext *ctx,
}
if (bpt) {
- StoreTexImageFunc storeImage =
- _mesa_get_texstore_func(texImage->TexFormat->MesaFormat);
-
src = _s;
dst = _d;
- storeImage(ctx, 2, texImage->_BaseFormat,
- texImage->TexFormat, dstImage,
- 0, 0, 0, /* dstX/Y/Zoffset */
- dstWidth * bpt,
- 0, /* dstImageStride */
- dstWidth, dstHeight, 1,
- GL_BGRA, CHAN_TYPE, dst, &ctx->DefaultPacking);
+ _mesa_texstore(ctx, 2, texImage->_BaseFormat,
+ texImage->TexFormat, dstImage,
+ 0, 0, 0, /* dstX/Y/Zoffset */
+ dstWidth * bpt,
+ 0, /* dstImageStride */
+ dstWidth, dstHeight, 1,
+ GL_BGRA, CHAN_TYPE, dst, &ctx->DefaultPacking);
FREE(dst);
FREE(src);
}
@@ -1239,21 +1236,19 @@ adjust2DRatio (GLcontext *ctx,
if (!texImage->IsCompressed) {
GLubyte *destAddr;
- StoreTexImageFunc storeImage =
- _mesa_get_texstore_func(texImage->TexFormat->MesaFormat);
tempImage = MALLOC(width * height * texelBytes);
if (!tempImage) {
return GL_FALSE;
}
- storeImage(ctx, 2, texImage->_BaseFormat,
- texImage->TexFormat, tempImage,
- 0, 0, 0, /* dstX/Y/Zoffset */
- width * texelBytes, /* dstRowStride */
- 0, /* dstImageStride */
- width, height, 1,
- format, type, pixels, packing);
+ _mesa_texstore(ctx, 2, texImage->_BaseFormat,
+ texImage->TexFormat, tempImage,
+ 0, 0, 0, /* dstX/Y/Zoffset */
+ width * texelBytes, /* dstRowStride */
+ 0, /* dstImageStride */
+ width, height, 1,
+ format, type, pixels, packing);
/* now rescale */
/* compute address of dest subimage within the overal tex image */
@@ -1270,8 +1265,6 @@ adjust2DRatio (GLcontext *ctx,
} else {
const GLint rawBytes = 4;
GLvoid *rawImage = MALLOC(width * height * rawBytes);
- StoreTexImageFunc storeImage =
- _mesa_get_texstore_func(texImage->TexFormat->MesaFormat);
if (!rawImage) {
return GL_FALSE;
@@ -1294,13 +1287,13 @@ adjust2DRatio (GLcontext *ctx,
width, height, /* src */
newWidth, newHeight, /* dst */
rawImage /*src*/, tempImage /*dst*/ );
- storeImage(ctx, 2, texImage->_BaseFormat,
- texImage->TexFormat, texImage->Data,
- xoffset * mml->wScale, yoffset * mml->hScale, 0, /* dstX/Y/Zoffset */
- dstRowStride,
- 0, /* dstImageStride */
- newWidth, newHeight, 1,
- GL_RGBA, CHAN_TYPE, tempImage, &ctx->DefaultPacking);
+ _mesa_texstore(ctx, 2, texImage->_BaseFormat,
+ texImage->TexFormat, texImage->Data,
+ xoffset * mml->wScale, yoffset * mml->hScale, 0, /* dstX/Y/Zoffset */
+ dstRowStride,
+ 0, /* dstImageStride */
+ newWidth, newHeight, 1,
+ GL_RGBA, CHAN_TYPE, tempImage, &ctx->DefaultPacking);
FREE(rawImage);
}
@@ -1441,16 +1434,13 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level,
else {
/* no rescaling needed */
/* unpack image, apply transfer ops and store in texImage->Data */
- StoreTexImageFunc storeImage =
- _mesa_get_texstore_func(texImage->TexFormat->MesaFormat);
-
- storeImage(ctx, 2, texImage->_BaseFormat,
- texImage->TexFormat, texImage->Data,
- 0, 0, 0, /* dstX/Y/Zoffset */
- dstRowStride,
- 0, /* dstImageStride */
- width, height, 1,
- format, type, pixels, packing);
+ _mesa_texstore(ctx, 2, texImage->_BaseFormat,
+ texImage->TexFormat, texImage->Data,
+ 0, 0, 0, /* dstX/Y/Zoffset */
+ dstRowStride,
+ 0, /* dstImageStride */
+ width, height, 1,
+ format, type, pixels, packing);
}
/* GL_SGIS_generate_mipmap */
@@ -1557,16 +1547,13 @@ fxDDTexSubImage2D(GLcontext * ctx, GLenum target, GLint level,
}
else {
/* no rescaling needed */
- StoreTexImageFunc storeImage =
- _mesa_get_texstore_func(texImage->TexFormat->MesaFormat);
-
- storeImage(ctx, 2, texImage->_BaseFormat,
- texImage->TexFormat, (GLubyte *) texImage->Data,
- xoffset, yoffset, 0, /* dstX/Y/Zoffset */
- dstRowStride,
- 0, /* dstImageStride */
- width, height, 1,
- format, type, pixels, packing);
+ _mesa_texstore(ctx, 2, texImage->_BaseFormat,
+ texImage->TexFormat, (GLubyte *) texImage->Data,
+ xoffset, yoffset, 0, /* dstX/Y/Zoffset */
+ dstRowStride,
+ 0, /* dstImageStride */
+ width, height, 1,
+ format, type, pixels, packing);
}
/* GL_SGIS_generate_mipmap */