mesa: code movement
authorBrian Paul <brianp@vmware.com>
Mon, 28 Sep 2009 02:40:53 +0000 (20:40 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 28 Sep 2009 02:40:53 +0000 (20:40 -0600)
src/mesa/main/formats.c
src/mesa/main/formats.h

index afa2398ed4143d86ad51d9153cd3769c2b575b60..2ad5685883ef51a5bc027babed98344cdf8b3e37 100644 (file)
@@ -594,6 +594,45 @@ _mesa_get_format_bytes(gl_format format)
 }
 
 
+GLint
+_mesa_get_format_bits(gl_format format, GLenum pname)
+{
+   const struct gl_format_info *info = _mesa_get_format_info(format);
+
+   switch (pname) {
+   case GL_TEXTURE_RED_SIZE:
+      return info->RedBits;
+   case GL_TEXTURE_GREEN_SIZE:
+      return info->GreenBits;
+   case GL_TEXTURE_BLUE_SIZE:
+      return info->BlueBits;
+   case GL_TEXTURE_ALPHA_SIZE:
+      return info->AlphaBits;
+   case GL_TEXTURE_INTENSITY_SIZE:
+      return info->IntensityBits;
+   case GL_TEXTURE_LUMINANCE_SIZE:
+      return info->LuminanceBits;
+   case GL_TEXTURE_INDEX_SIZE_EXT:
+      return info->IndexBits;
+   case GL_TEXTURE_DEPTH_SIZE_ARB:
+      return info->DepthBits;
+   case GL_TEXTURE_STENCIL_SIZE_EXT:
+      return info->StencilBits;
+   default:
+      _mesa_problem(NULL, "bad pname in _mesa_get_format_bits()");
+      return 0;
+   }
+}
+
+
+GLenum
+_mesa_get_format_datatype(gl_format format)
+{
+   const struct gl_format_info *info = _mesa_get_format_info(format);
+   return info->DataType;
+}
+
+
 GLenum
 _mesa_get_format_base_format(gl_format format)
 {
@@ -785,42 +824,3 @@ _mesa_format_to_type_and_comps2(gl_format format,
       *datatype = GL_UNSIGNED_BYTE;
    }
 }
-
-
-GLint
-_mesa_get_format_bits(gl_format format, GLenum pname)
-{
-   const struct gl_format_info *info = _mesa_get_format_info(format);
-
-   switch (pname) {
-   case GL_TEXTURE_RED_SIZE:
-      return info->RedBits;
-   case GL_TEXTURE_GREEN_SIZE:
-      return info->GreenBits;
-   case GL_TEXTURE_BLUE_SIZE:
-      return info->BlueBits;
-   case GL_TEXTURE_ALPHA_SIZE:
-      return info->AlphaBits;
-   case GL_TEXTURE_INTENSITY_SIZE:
-      return info->IntensityBits;
-   case GL_TEXTURE_LUMINANCE_SIZE:
-      return info->LuminanceBits;
-   case GL_TEXTURE_INDEX_SIZE_EXT:
-      return info->IndexBits;
-   case GL_TEXTURE_DEPTH_SIZE_ARB:
-      return info->DepthBits;
-   case GL_TEXTURE_STENCIL_SIZE_EXT:
-      return info->StencilBits;
-   default:
-      _mesa_problem(NULL, "bad pname in _mesa_get_format_bits()");
-      return 0;
-   }
-}
-
-
-GLenum
-_mesa_get_format_datatype(gl_format format)
-{
-   const struct gl_format_info *info = _mesa_get_format_info(format);
-   return info->DataType;
-}
index ad93fef2fcbbe466d8574430f37acc9b60bab1e7..dbde28e727ace8a0c1785e499a32f601463c4c2c 100644 (file)
@@ -198,6 +198,12 @@ struct gl_format_info
 extern GLuint
 _mesa_get_format_bytes(gl_format format);
 
+extern GLint
+_mesa_get_format_bits(gl_format format, GLenum pname);
+
+extern GLenum
+_mesa_get_format_datatype(gl_format format);
+
 extern GLenum
 _mesa_get_format_base_format(gl_format format);
 
@@ -208,13 +214,6 @@ extern void
 _mesa_format_to_type_and_comps2(gl_format format,
                                 GLenum *datatype, GLuint *comps);
 
-extern GLint
-_mesa_get_format_bits(gl_format format, GLenum pname);
-
-extern GLenum
-_mesa_get_format_datatype(gl_format format);
-
-
 extern void
 _mesa_test_formats(void);