From 5f1f229f8da255ca9b390da1757ad781978cf619 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 7 Jan 2005 02:39:09 +0000 Subject: 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. --- src/glx/x11/compsize.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/glx/x11/compsize.c') 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 -#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; } -- cgit v1.2.3