summaryrefslogtreecommitdiff
path: root/src/glx/x11/compsize.c
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2005-01-07 02:39:09 +0000
committerIan Romanick <idr@us.ibm.com>2005-01-07 02:39:09 +0000
commit5f1f229f8da255ca9b390da1757ad781978cf619 (patch)
tree14a550730dc7a2ceb74ef84183b518460d2e1b68 /src/glx/x11/compsize.c
parent3385d7cec3308129f6f1fc5990023417e4e4be47 (diff)
Pixel oriented render functions are now generated by the
glX_proto_send.py script. This eliminates ~600 lines of non-generated code. With proper compiler optimization settings, it also decreases the size of libGL.so by about 3KB.
Diffstat (limited to 'src/glx/x11/compsize.c')
-rw-r--r--src/glx/x11/compsize.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/glx/x11/compsize.c b/src/glx/x11/compsize.c
index 9529496b12..973b640a87 100644
--- a/src/glx/x11/compsize.c
+++ b/src/glx/x11/compsize.c
@@ -35,7 +35,7 @@
*/
#include <GL/gl.h>
-#include "size.h"
+#include "indirect_size.h"
/*
** Return the number of elements per group of a specified format
@@ -147,14 +147,28 @@ GLint __glBytesPerElement(GLenum type)
** and format.
*/
GLint __glImageSize(GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type)
+ GLenum format, GLenum type, GLenum target)
{
int bytes_per_row;
int components;
+ switch( target ) {
+ case GL_PROXY_TEXTURE_1D:
+ case GL_PROXY_TEXTURE_2D:
+ case GL_PROXY_TEXTURE_3D:
+ case GL_PROXY_TEXTURE_4D_SGIS:
+ case GL_PROXY_TEXTURE_CUBE_MAP:
+ case GL_PROXY_TEXTURE_RECTANGLE_ARB:
+ case GL_PROXY_COLOR_TABLE:
+ case GL_PROXY_POST_CONVOLUTION_COLOR_TABLE:
+ case GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE:
+ return 0;
+ }
+
if (width < 0 || height < 0 || depth < 0) {
return 0;
}
+
/*
** Zero is returned if either format or type are invalid.
*/
@@ -168,5 +182,6 @@ GLint __glImageSize(GLsizei width, GLsizei height, GLsizei depth,
} else {
bytes_per_row = __glBytesPerElement(type) * width;
}
+
return bytes_per_row * height * depth * components;
}