Fix for write-rgba-span and others
authorKeith Whitwell <keith@tungstengraphics.com>
Fri, 17 Sep 1999 15:14:02 +0000 (15:14 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Fri, 17 Sep 1999 15:14:02 +0000 (15:14 +0000)
src/mesa/drivers/glide/fxddspan.c

index fc7c38d5c44ffaa06ddac67ed97930ba75061489..21b48ae789b7c7fe895a16b2848920dd56304df6 100644 (file)
 
 #if !defined(FXMESA_USE_ARGB) 
 
-    #define LFB_WRITE_SPAN_MESA(dst_buffer,dst_x,dst_y,src_width,src_stride,src_data)  \
-         grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_width,1,GR_LFB_SRC_FMT_8888,src_stride,src_data)
+/* KW: Rearranged the args in the call to grLfbWriteRegion().
+ */
+#define LFB_WRITE_SPAN_MESA(dst_buffer,                \
+                           dst_x,              \
+                           dst_y,              \
+                           src_width,          \
+                           src_stride,         \
+                           src_data)           \
+  grLfbWriteRegion(dst_buffer,                 \
+                  dst_x,                       \
+                  dst_y,                       \
+                  GR_LFB_SRC_FMT_8888,         \
+                  src_width,                   \
+                  1,                           \
+                  src_stride,                  \
+                  src_data)                    \
+
+
 #else /* defined(FXMESA_USE_RGBA) */
 
-       #define MESACOLOR_TO_ARGB(c) (       \
-             ( ((unsigned int)(c[ACOMP]))<<24 ) | \
-             ( ((unsigned int)(c[RCOMP]))<<16 ) | \
-             ( ((unsigned int)(c[GCOMP]))<<8 )  | \
+#define MESACOLOR_TO_ARGB(c) (                         \
+             ( ((unsigned int)(c[ACOMP]))<<24 ) |      \
+             ( ((unsigned int)(c[RCOMP]))<<16 ) |      \
+             ( ((unsigned int)(c[GCOMP]))<<8 )  |      \
              (  (unsigned int)(c[BCOMP])) )
   
-      /* inline */ void LFB_WRITE_SPAN_MESA(GrBuffer_t dst_buffer, 
-                                 FxU32 dst_x, FxU32 dst_y, 
-                                 /* GrLfbSrcFmt_t src_format, format is GR_LFB_SRC_FMT_8888 */
-                                 FxU32 src_width,/* FxU32 src_height,  height is 1 */
-                                 FxI32 src_stride, void *src_data )
-       {
-             /* Covert to ARGB */
-             GLubyte (*rgba)[4] = src_data;
-             GLuint argb[MAX_WIDTH];
-             int i;
+void LFB_WRITE_SPAN_MESA(GrBuffer_t dst_buffer, 
+                        FxU32 dst_x, 
+                        FxU32 dst_y, 
+                        FxU32 src_width,
+                        FxI32 src_stride, 
+                        void *src_data )
+{
+   /* Covert to ARGB */
+   GLubyte (*rgba)[4] = src_data;
+   GLuint argb[MAX_WIDTH];
+   int i;
    
-             for (i = 0; i < src_width; i++)
-             {
-                argb[i] = MESACOLOR_TO_ARGB(rgba[i]);
-             }
-           FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,GR_LFB_SRC_FMT_8888,src_width,1,src_stride,(void*)argb);
-       }
+   for (i = 0; i < src_width; i++)
+   {
+      argb[i] = MESACOLOR_TO_ARGB(rgba[i]);
+   }
+   FX_grLfbWriteRegion(dst_buffer,
+                      dst_x,
+                      dst_y,
+                      GR_LFB_SRC_FMT_8888,
+                      src_width,
+                      1,
+                      src_stride,
+                      (void*)argb);
+}
+
 #endif
 
 /************************************************************************/
 /*****                    Span functions                            *****/
 /************************************************************************/
 
+
 static void fxDDWriteRGBASpan(const GLcontext *ctx, 
                               GLuint n, GLint x, GLint y,
                               const GLubyte rgba[][4], const GLubyte mask[])