drisw: Move pointer dereferences to after NULL checks.
[mesa.git] / src / mesa / state_tracker / st_format.h
index e4a788c89bb2343a712bd36147f9caec6b046ea5..a6cf7025a92789c64425f2e95264316637180ec5 100644 (file)
@@ -1,6 +1,7 @@
 /**************************************************************************
  * 
  * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright (c) 2010 VMware, Inc.
  * All Rights Reserved.
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
 #ifndef ST_FORMAT_H
 #define ST_FORMAT_H
 
-
-struct pipe_format_info
-{
-   enum pipe_format format;
-   GLenum base_format;
-   GLenum datatype;
-   GLubyte red_bits;
-   GLubyte green_bits;
-   GLubyte blue_bits;
-   GLubyte alpha_bits;
-   GLubyte luminance_bits;
-   GLubyte intensity_bits;
-   GLubyte depth_bits;
-   GLubyte stencil_bits;
-   GLubyte size;           /**< in bytes */
-};
-
-
-GLboolean
-st_get_format_info(enum pipe_format format, struct pipe_format_info *pinfo);
-
-
-extern GLuint
-st_sizeof_format(enum pipe_format format);
+#include "main/formats.h"
 
 
 extern GLenum
@@ -60,7 +38,10 @@ st_format_datatype(enum pipe_format format);
 
 
 extern enum pipe_format
-st_mesa_format_to_pipe_format(GLuint mesaFormat);
+st_mesa_format_to_pipe_format(gl_format mesaFormat);
+
+extern gl_format
+st_pipe_format_to_mesa_format(enum pipe_format pipeFormat);
 
 
 extern enum pipe_format
@@ -72,7 +53,7 @@ st_choose_renderbuffer_format(struct pipe_screen *screen,
                               GLenum internalFormat);
 
 
-extern const struct gl_texture_format *
+extern gl_format
 st_ChooseTextureFormat(GLcontext * ctx, GLint internalFormat,
                        GLenum format, GLenum type);
 
@@ -81,4 +62,4 @@ extern GLboolean
 st_equal_formats(enum pipe_format pFormat, GLenum format, GLenum type);
 
 
-#endif /* ST_CB_TEXIMAGE_H */
+#endif /* ST_FORMAT_H */