Mesa (master): mesa: remove unused _mesa_rescale_teximage2d() function

Brian Paul brianp at kemper.freedesktop.org
Wed Oct 5 20:17:05 PDT 2011


Module: Mesa
Branch: master
Commit: c80aaad77e7d884ebe83ac72467d55ac505da5ee
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c80aaad77e7d884ebe83ac72467d55ac505da5ee

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Oct  5 21:14:37 2011 -0600

mesa: remove unused _mesa_rescale_teximage2d() function

It was only used by the old tdfx driver, IIRC.

---

 src/mesa/main/mipmap.c |   75 ------------------------------------------------
 src/mesa/main/mipmap.h |    9 ------
 2 files changed, 0 insertions(+), 84 deletions(-)

diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
index 1fa49ca..f04a98b 100644
--- a/src/mesa/main/mipmap.c
+++ b/src/mesa/main/mipmap.c
@@ -2048,78 +2048,3 @@ _mesa_generate_mipmap(struct gl_context *ctx, GLenum target,
       generate_mipmap_uncompressed(ctx, target, texObj, srcImage, maxLevel);
    }
 }
-
-
-/**
- * Helper function for drivers which need to rescale texture images to
- * certain aspect ratios.
- * Nearest filtering only (for broken hardware that can't support
- * all aspect ratios).  This can be made a lot faster, but I don't
- * really care enough...
- */
-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;
-
-#define INNER_LOOP( TYPE, HOP, WOP )					\
-   for ( row = 0 ; row < dstHeight ; row++ ) {				\
-      GLint srcRow = row HOP hScale;					\
-      for ( col = 0 ; col < dstWidth ; col++ ) {			\
-	 GLint srcCol = col WOP wScale;					\
-	 dst[col] = src[srcRow * srcStrideInPixels + srcCol];		\
-      }									\
-      dst = (TYPE *) ((GLubyte *) dst + dstRowStride);			\
-   }									\
-
-#define RESCALE_IMAGE( TYPE )						\
-do {									\
-   const TYPE *src = (const TYPE *)srcImage;				\
-   TYPE *dst = (TYPE *)dstImage;					\
-									\
-   if ( srcHeight < dstHeight ) {					\
-      const GLint hScale = dstHeight / srcHeight;			\
-      if ( srcWidth < dstWidth ) {					\
-	 const GLint wScale = dstWidth / srcWidth;			\
-	 INNER_LOOP( TYPE, /, / );					\
-      }									\
-      else {								\
-	 const GLint wScale = srcWidth / dstWidth;			\
-	 INNER_LOOP( TYPE, /, * );					\
-      }									\
-   }									\
-   else {								\
-      const GLint hScale = srcHeight / dstHeight;			\
-      if ( srcWidth < dstWidth ) {					\
-	 const GLint wScale = dstWidth / srcWidth;			\
-	 INNER_LOOP( TYPE, *, / );					\
-      }									\
-      else {								\
-	 const GLint wScale = srcWidth / dstWidth;			\
-	 INNER_LOOP( TYPE, *, * );					\
-      }									\
-   }									\
-} while (0)
-
-   switch ( bytesPerPixel ) {
-   case 4:
-      RESCALE_IMAGE( GLuint );
-      break;
-
-   case 2:
-      RESCALE_IMAGE( GLushort );
-      break;
-
-   case 1:
-      RESCALE_IMAGE( GLubyte );
-      break;
-   default:
-      _mesa_problem(NULL,"unexpected bytes/pixel in _mesa_rescale_teximage2d");
-   }
-}
-
diff --git a/src/mesa/main/mipmap.h b/src/mesa/main/mipmap.h
index 8b7cd7d..1fb9146 100644
--- a/src/mesa/main/mipmap.h
+++ b/src/mesa/main/mipmap.h
@@ -46,13 +46,4 @@ _mesa_generate_mipmap(struct gl_context *ctx, GLenum target,
                       struct gl_texture_object *texObj);
 
 
-extern void
-_mesa_rescale_teximage2d(GLuint bytesPerPixel,
-                         GLuint srcStrideInPixels,
-                         GLuint dstRowStride,
-                         GLint srcWidth, GLint srcHeight,
-                         GLint dstWidth, GLint dstHeight,
-                         const GLvoid *srcImage, GLvoid *dstImage);
-
-
 #endif /* MIPMAP_H */



More information about the mesa-commit mailing list