st/mesa: refactor guess_and_alloc_texture() code
[mesa.git] / src / mesa / main / image.c
index df1527b47f1b1ec899d58b615c92656e07618709..63936132f98bd3e1cacd3de54037f6cbc9516a29 100644 (file)
@@ -35,6 +35,8 @@
 #include "image.h"
 #include "imports.h"
 #include "macros.h"
+#include "mfeatures.h"
+#include "mtypes.h"
 
 
 /**
@@ -66,6 +68,7 @@ _mesa_type_is_packed(GLenum type)
    switch (type) {
    case GL_UNSIGNED_BYTE_3_3_2:
    case GL_UNSIGNED_BYTE_2_3_3_REV:
+   case MESA_UNSIGNED_BYTE_4_4:
    case GL_UNSIGNED_SHORT_5_6_5:
    case GL_UNSIGNED_SHORT_5_6_5_REV:
    case GL_UNSIGNED_SHORT_4_4_4_4:
@@ -154,6 +157,8 @@ _mesa_sizeof_type( GLenum type )
         return sizeof(GLdouble);
       case GL_HALF_FLOAT_ARB:
         return sizeof(GLhalfARB);
+      case GL_FIXED:
+        return sizeof(GLfixed);
       default:
          return -1;
    }
@@ -190,6 +195,8 @@ _mesa_sizeof_packed_type( GLenum type )
          return sizeof(GLubyte);
       case GL_UNSIGNED_BYTE_2_3_3_REV:
          return sizeof(GLubyte);
+      case MESA_UNSIGNED_BYTE_4_4:
+         return sizeof(GLubyte);
       case GL_UNSIGNED_SHORT_5_6_5:
          return sizeof(GLushort);
       case GL_UNSIGNED_SHORT_5_6_5_REV:
@@ -1577,8 +1584,8 @@ _mesa_clip_drawpixels(const struct gl_context *ctx,
  * scissor box is ignored, and we use the bounds of the current readbuffer
  * surface.
  *
- * \return  GL_TRUE if image is ready for drawing or
- *          GL_FALSE if image was completely clipped away (draw nothing)
+ * \return  GL_TRUE if region to read is in bounds
+ *          GL_FALSE if region is completely out of bounds (nothing to read)
  */
 GLboolean
 _mesa_clip_readpixels(const struct gl_context *ctx,