* all aspect ratios). This can be made a lot faster, but I don't
* really care enough...
*/
-void _mesa_rescale_teximage2d( GLuint bytesPerPixel, GLuint dstRowStride,
- GLint srcWidth, GLint srcHeight,
- GLint dstWidth, GLint dstHeight,
- const GLvoid *srcImage, GLvoid *dstImage )
+void
+_mesa_rescale_teximage2d (GLuint bytesPerPixel,
+ GLuint srcStrideInPixels,
+ GLuint dstRowStride,
+ GLint srcWidth, GLint srcHeight,
+ GLint dstWidth, GLint dstHeight,
+ const GLvoid *srcImage, GLvoid *dstImage)
{
GLint row, col;
GLint srcRow = row HOP hScale; \
for ( col = 0 ; col < dstWidth ; col++ ) { \
GLint srcCol = col WOP wScale; \
- dst[col] = src[srcRow * srcWidth + srcCol]; \
+ dst[col] = src[srcRow * srcStrideInPixels + srcCol]; \
} \
dst = (TYPE *) ((GLubyte *) dst + dstRowStride); \
} \
const TYPE *src = (const TYPE *)srcImage; \
TYPE *dst = (TYPE *)dstImage; \
\
- if ( srcHeight <= dstHeight ) { \
+ if ( srcHeight < dstHeight ) { \
const GLint hScale = dstHeight / srcHeight; \
- if ( srcWidth <= dstWidth ) { \
+ if ( srcWidth < dstWidth ) { \
const GLint wScale = dstWidth / srcWidth; \
INNER_LOOP( TYPE, /, / ); \
} \
} \
else { \
const GLint hScale = srcHeight / dstHeight; \
- if ( srcWidth <= dstWidth ) { \
+ if ( srcWidth < dstWidth ) { \
const GLint wScale = dstWidth / srcWidth; \
INNER_LOOP( TYPE, *, / ); \
} \
extern void
-_mesa_rescale_teximage2d(GLuint bytesPerPixel, GLuint dstRowStride,
- GLint srcWidth, GLint srcHeight,
- GLint dstWidth, GLint dstHeight,
- const GLvoid *srcImage, GLvoid *dstImage);
+_mesa_rescale_teximage2d (GLuint bytesPerPixel,
+ GLuint srcStrideInPixels,
+ GLuint dstRowStride,
+ GLint srcWidth, GLint srcHeight,
+ GLint dstWidth, GLint dstHeight,
+ const GLvoid *srcImage, GLvoid *dstImage);
extern void
_mesa_upscale_teximage2d( GLsizei inWidth, GLsizei inHeight,