Revert "Fix 24bpp software rendering"
authorBrian Paul <brianp@vmware.com>
Sat, 25 Jun 2011 12:17:01 +0000 (06:17 -0600)
committerBrian Paul <brianp@vmware.com>
Sat, 25 Jun 2011 12:17:01 +0000 (06:17 -0600)
This reverts commit c0c0bb6cb140825f5bab3c40c0c9c0ec575fbc76.

src/mesa/drivers/dri/swrast/swrast.c
src/mesa/drivers/dri/swrast/swrast_priv.h
src/mesa/drivers/dri/swrast/swrast_span.c

index 90b5ef0fc210d2ae508d3551989a6e4e65466bcb..719b406ec05feeef79ff22f8dace5ba3230d3954 100644 (file)
@@ -233,17 +233,10 @@ choose_pixel_format(const struct gl_config *v)
        && v->blueMask  == 0x0000ff)
        return PF_A8R8G8B8;
     else if (depth == 24
-             && v->depthBits == 32
-             && v->redMask   == 0xff0000
-             && v->greenMask == 0x00ff00
-             && v->blueMask  == 0x0000ff)
-        return PF_X8R8G8B8;
-    else if (depth == 24
-             && v->depthBits == 24
-             && v->redMask   == 0xff0000
-             && v->greenMask == 0x00ff00
-             && v->blueMask  == 0x0000ff)
-        return PF_R8G8B8;
+            && v->redMask   == 0xff0000
+            && v->greenMask == 0x00ff00
+            && v->blueMask  == 0x0000ff)
+       return PF_X8R8G8B8;
     else if (depth == 16
             && v->redMask   == 0xf800
             && v->greenMask == 0x07e0
@@ -351,13 +344,6 @@ swrast_new_renderbuffer(const struct gl_config *visual, GLboolean front)
        xrb->Base.DataType = GL_UNSIGNED_BYTE;
        xrb->bpp = 32;
        break;
-    case PF_R8G8B8:
-        xrb->Base.Format = MESA_FORMAT_RGB888;
-        xrb->Base.InternalFormat = GL_RGB;
-        xrb->Base._BaseFormat = GL_RGB;
-        xrb->Base.DataType = GL_UNSIGNED_BYTE;
-        xrb->bpp = 24;
-        break;
     case PF_R5G6B5:
        xrb->Base.Format = MESA_FORMAT_RGB565;
        xrb->Base.InternalFormat = GL_RGB;
index 40f787f52df4caf0025de3b6f1261a1cfda14056..bdb52ef26f10a093725b98e0015a1e141f888bf3 100644 (file)
@@ -123,7 +123,6 @@ swrast_renderbuffer(struct gl_renderbuffer *rb)
 #define PF_R5G6B5     2                /**< 16bpp TrueColor:  5-R, 6-G, 5-B bits */
 #define PF_R3G3B2     3                /**<  8bpp TrueColor:  3-R, 3-G, 2-B bits */
 #define PF_X8R8G8B8   4                /**< 32bpp TrueColor:  8-R, 8-G, 8-B bits */
-#define PF_R8G8B8     5         /**< 24bpp TrueColor:  8-R, 8-G, 8-B bits */
 
 
 /* swrast_span.c */
index 71aafbbe5d3049583936fd759ad6c24f0b216af2..c7d0bfdac72b6fdb8f11aae3fcd316923e942082 100644 (file)
@@ -81,22 +81,6 @@ static const GLubyte kernel[16] = {
    DST[BCOMP] = *SRC & 0xff
 
 
-/* 24-bit BGR */
-#define STORE_PIXEL_R8G8B8(DST, X, Y, VALUE) \
-   DST[2] = VALUE[RCOMP]; \
-   DST[1] = VALUE[GCOMP]; \
-   DST[0] = VALUE[BCOMP]
-#define STORE_PIXEL_RGB_R8G8B8(DST, X, Y, VALUE) \
-   DST[2] = VALUE[RCOMP]; \
-   DST[1] = VALUE[GCOMP]; \
-   DST[0] = VALUE[BCOMP]
-#define FETCH_PIXEL_R8G8B8(DST, SRC) \
-   DST[ACOMP] = 0xff;                  \
-   DST[RCOMP] = (*SRC >> 16) & 0xff;   \
-   DST[GCOMP] = (*SRC >> 8) & 0xff;    \
-   DST[BCOMP] = *SRC & 0xff
-
-
 /* 16-bit BGR */
 #define STORE_PIXEL_R5G6B5(DST, X, Y, VALUE) \
    do { \
@@ -173,24 +157,6 @@ static const GLubyte kernel[16] = {
 #include "swrast/s_spantemp.h"
 
 
-/* 24-bit BGR */
-#define NAME(FUNC) FUNC##_R8G8B8
-#define RB_TYPE GLubyte
-#define SPAN_VARS \
-   struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb);
-#define INIT_PIXEL_PTR(P, X, Y) \
-   GLubyte *P = (GLubyte *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch + (3*X);
-#define INC_PIXEL_PTR(P) P+=3
-#define STORE_PIXEL(DST, X, Y, VALUE) \
-   STORE_PIXEL_R8G8B8(DST, X, Y, VALUE)
-#define STORE_PIXEL_RGB(DST, X, Y, VALUE) \
-   STORE_PIXEL_RGB_R8G8B8(DST, X, Y, VALUE)
-#define FETCH_PIXEL(DST, SRC) \
-   FETCH_PIXEL_R8G8B8(DST, SRC)
-
-#include "swrast/s_spantemp.h"
-
-
 /* 16-bit BGR */
 #define NAME(FUNC) FUNC##_R5G6B5
 #define RB_TYPE GLubyte
@@ -263,24 +229,6 @@ static const GLubyte kernel[16] = {
 #include "swrast_spantemp.h"
 
 
-/* 24-bit BGR */
-#define NAME(FUNC) FUNC##_R8G8B8_front
-#define RB_TYPE GLubyte
-#define SPAN_VARS \
-   struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb);
-#define INIT_PIXEL_PTR(P, X, Y) \
-   GLubyte *P = (GLubyte *)row;
-#define INC_PIXEL_PTR(P) P+=3
-#define STORE_PIXEL(DST, X, Y, VALUE) \
-   STORE_PIXEL_R8G8B8(DST, X, Y, VALUE)
-#define STORE_PIXEL_RGB(DST, X, Y, VALUE) \
-   STORE_PIXEL_RGB_R8G8B8(DST, X, Y, VALUE)
-#define FETCH_PIXEL(DST, SRC) \
-   FETCH_PIXEL_R8G8B8(DST, SRC)
-
-#include "swrast_spantemp.h"
-
-
 /* 16-bit BGR */
 #define NAME(FUNC) FUNC##_R5G6B5_front
 #define RB_TYPE GLubyte
@@ -342,15 +290,6 @@ swrast_set_span_funcs_back(struct swrast_renderbuffer *xrb,
        xrb->Base.PutValues = put_values_X8R8G8B8;
        xrb->Base.PutMonoValues = put_mono_values_X8R8G8B8;
        break;
-   case PF_R8G8B8:
-        xrb->Base.GetRow = get_row_R8G8B8;
-        xrb->Base.GetValues = get_values_R8G8B8;
-        xrb->Base.PutRow = put_row_R8G8B8;
-        xrb->Base.PutRowRGB = put_row_rgb_R8G8B8;
-        xrb->Base.PutMonoRow = put_mono_row_R8G8B8;
-        xrb->Base.PutValues = put_values_R8G8B8;
-        xrb->Base.PutMonoValues = put_mono_values_R8G8B8;
-        break;
     case PF_R5G6B5:
        xrb->Base.GetRow = get_row_R5G6B5;
        xrb->Base.GetValues = get_values_R5G6B5;
@@ -407,15 +346,6 @@ swrast_set_span_funcs_front(struct swrast_renderbuffer *xrb,
        xrb->Base.PutValues = put_values_X8R8G8B8_front;
        xrb->Base.PutMonoValues = put_mono_values_X8R8G8B8_front;
        break;
-    case PF_R8G8B8:
-        xrb->Base.GetRow = get_row_R8G8B8_front;
-        xrb->Base.GetValues = get_values_R8G8B8_front;
-        xrb->Base.PutRow = put_row_R8G8B8_front;
-        xrb->Base.PutRowRGB = put_row_rgb_R8G8B8_front;
-        xrb->Base.PutMonoRow = put_mono_row_R8G8B8_front;
-        xrb->Base.PutValues = put_values_R8G8B8_front;
-        xrb->Base.PutMonoValues = put_mono_values_R8G8B8_front;
-        break;
     case PF_R5G6B5:
        xrb->Base.GetRow = get_row_R5G6B5_front;
        xrb->Base.GetValues = get_values_R5G6B5_front;