Merge commit 'origin/gallium-0.1' into gallium-0.2
[mesa.git] / src / mesa / drivers / dri / swrast / swrast_priv.h
index d801f88f072f7457fb0a56665b847fedaaf95a81..a707ffc40a88f5c203f0f6e463a0e88538962419 100644 (file)
 
 #include <GL/gl.h>
 #include <GL/internal/dri_interface.h>
-#include "mtypes.h"
+#include "main/mtypes.h"
 
+
+/**
+ * Debugging
+ */
 #define DEBUG_CORE     0
-#define DEBUG_SPAN     1
+#define DEBUG_SPAN     0
 
 #if DEBUG_CORE
 #define TRACE _mesa_printf("--> %s\n", __FUNCTION__)
@@ -77,28 +81,30 @@ struct __DRIdrawableRec {
 
     __DRIscreen *driScreenPriv;
 
+    /* scratch row for optimized front-buffer rendering */
     char *row;
 };
 
 struct swrast_renderbuffer {
     struct gl_renderbuffer Base;
 
+    /* renderbuffer pitch (in bytes) */
     GLuint pitch;
 };
 
-static inline __DRIcontext *
+static INLINE __DRIcontext *
 swrast_context(GLcontext *ctx)
 {
     return (__DRIcontext *) ctx;
 }
 
-static inline __DRIdrawable *
+static INLINE __DRIdrawable *
 swrast_drawable(GLframebuffer *fb)
 {
     return (__DRIdrawable *) fb;
 }
 
-static inline struct swrast_renderbuffer *
+static INLINE struct swrast_renderbuffer *
 swrast_renderbuffer(struct gl_renderbuffer *rb)
 {
     return (struct swrast_renderbuffer *) rb;
@@ -111,16 +117,26 @@ swrast_renderbuffer(struct gl_renderbuffer *rb)
 #define PF_CI8        1                /**< Color Index mode */
 #define PF_A8R8G8B8   2                /**< 32-bit TrueColor:  8-A, 8-R, 8-G, 8-B bits */
 #define PF_R5G6B5     3                /**< 16-bit TrueColor:  5-R, 6-G, 5-B bits */
+#define PF_R3G3B2     4                /**<  8-bit TrueColor:  3-R, 3-G, 2-B bits */
+
+
+/**
+ * Renderbuffer pitch alignment (in bits).
+ *
+ * The xorg loader requires padding images to 32 bits. However, this should
+ * become a screen/drawable parameter XXX
+ */
+#define PITCH_ALIGN_BITS 32
 
 
 /* swrast_span.c */
 
 extern void
-swrast_set_span_funcs_ximage(struct swrast_renderbuffer *xrb,
-                            GLuint pixel_format);
+swrast_set_span_funcs_back(struct swrast_renderbuffer *xrb,
+                          GLuint pixel_format);
 
 extern void
-swrast_set_span_funcs_pixmap(struct swrast_renderbuffer *xrb,
-                            GLuint pixel_format);
+swrast_set_span_funcs_front(struct swrast_renderbuffer *xrb,
+                           GLuint pixel_format);
 
 #endif /* _SWRAST_PRIV_H_ */