aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/x11/xmesaP.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-11-12 11:50:31 -0700
committerBrian Paul <[email protected]>2011-11-15 07:49:25 -0700
commitbc63b226bcc94f109906bccce26d47509f28d177 (patch)
treeba944ec9581ec534f54bab6267b4a0808fd6402f /src/mesa/drivers/x11/xmesaP.h
parentc9bfad2921904780d982917def276a6979a5debd (diff)
xlib: remove a ton of old xlib driver cruft
The days of 1-bpp, 8-bpp and dithering are long behind us. Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/drivers/x11/xmesaP.h')
-rw-r--r--src/mesa/drivers/x11/xmesaP.h151
1 files changed, 1 insertions, 150 deletions
diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h
index 81dc25d52eb..7e1cb8a7d49 100644
--- a/src/mesa/drivers/x11/xmesaP.h
+++ b/src/mesa/drivers/x11/xmesaP.h
@@ -55,7 +55,6 @@ typedef void (*ClearFunc)( struct gl_context *ctx, struct xmesa_renderbuffer *xr
/** Framebuffer pixel formats */
enum pixel_format {
- PF_Index, /**< Color Index mode */
PF_Truecolor, /**< TrueColor or DirectColor, any depth */
PF_Dither_True, /**< TrueColor with dithering */
PF_8A8R8G8B, /**< 32-bit TrueColor: 8-A, 8-R, 8-G, 8-B bits */
@@ -63,11 +62,6 @@ enum pixel_format {
PF_8R8G8B, /**< 32-bit TrueColor: 8-R, 8-G, 8-B bits */
PF_8R8G8B24, /**< 24-bit TrueColor: 8-R, 8-G, 8-B bits */
PF_5R6G5B, /**< 16-bit TrueColor: 5-R, 6-G, 5-B bits */
- PF_Dither, /**< Color-mapped RGB with dither */
- PF_Lookup, /**< Color-mapped RGB without dither */
- PF_HPCR, /**< HP Color Recovery ([email protected] 30/08/95) */
- PF_1Bit, /**< monochrome dithering of RGB */
- PF_Grayscale, /**< Grayscale or StaticGray */
PF_Dither_5R6G5B /**< 16-bit dithered TrueColor: 5-R, 6-G, 5-B */
};
@@ -103,16 +97,6 @@ struct xmesa_visual {
GLubyte PixelToR[256]; /* Pixel to RGB conversion */
GLubyte PixelToG[256];
GLubyte PixelToB[256];
-
- /* For PF_HPCR */
- short hpcr_rgbTbl[3][256];
- GLboolean hpcr_clear_flag;
- GLubyte hpcr_clear_ximage_pattern[2][16];
- XMesaImage *hpcr_clear_ximage;
- XMesaPixmap hpcr_clear_pixmap;
-
- /* For PF_1BIT */
- int bitFlip;
};
@@ -174,8 +158,6 @@ struct xmesa_renderbuffer
XMesaPixmap pixmap; /* Back color buffer */
XMesaImage *ximage; /* The back buffer, if not using a Pixmap */
- GLubyte *origin1; /* used for PIXEL_ADDR1 macro */
- GLint width1;
GLushort *origin2; /* used for PIXEL_ADDR2 macro */
GLint width2;
GLubyte *origin3; /* used for PIXEL_ADDR3 macro */
@@ -317,134 +299,6 @@ struct xmesa_buffer {
-/**
- * If pixelformat==PF_DITHER:
- *
- * Improved 8-bit RGB dithering code contributed by Bob Mercier
- * ([email protected]). Thanks Bob!
- */
-#ifdef DITHER666
-# define DITH_R 6
-# define DITH_G 6
-# define DITH_B 6
-# define DITH_MIX(r,g,b) (((r) * DITH_G + (g)) * DITH_B + (b))
-#else
-# define DITH_R 5
-# define DITH_G 9
-# define DITH_B 5
-# define DITH_MIX(r,g,b) (((g) << 6) | ((b) << 3) | (r))
-#endif
-#define DITH_DX 4
-#define DITH_DY 4
-#define DITH_N (DITH_DX * DITH_DY)
-
-#define _dither(C, c, d) (((unsigned)((DITH_N * (C - 1) + 1) * c + d)) >> 12)
-
-#define MAXC 256
-extern const int xmesa_kernel8[DITH_DY * DITH_DX];
-
-/* Dither for random X,Y */
-#define DITHER_SETUP \
- int __d; \
- unsigned long *ctable = XMESA_BUFFER(ctx->DrawBuffer)->color_table;
-
-#define DITHER( X, Y, R, G, B ) \
- (__d = xmesa_kernel8[(((Y)&3)<<2) | ((X)&3)], \
- ctable[DITH_MIX(_dither(DITH_R, (R), __d), \
- _dither(DITH_G, (G), __d), \
- _dither(DITH_B, (B), __d))])
-
-/* Dither for random X, fixed Y */
-#define XDITHER_SETUP(Y) \
- int __d; \
- unsigned long *ctable = XMESA_BUFFER(ctx->DrawBuffer)->color_table; \
- const int *kernel = &xmesa_kernel8[ ((Y)&3) << 2 ];
-
-#define XDITHER( X, R, G, B ) \
- (__d = kernel[(X)&3], \
- ctable[DITH_MIX(_dither(DITH_R, (R), __d), \
- _dither(DITH_G, (G), __d), \
- _dither(DITH_B, (B), __d))])
-
-
-
-/*
- * Dithering for flat-shaded triangles. Precompute all 16 possible
- * pixel values given the triangle's RGB color. Contributed by Martin Shenk.
- */
-#define FLAT_DITHER_SETUP( R, G, B ) \
- GLushort ditherValues[16]; \
- { \
- unsigned long *ctable = XMESA_BUFFER(ctx->DrawBuffer)->color_table; \
- int msdr = (DITH_N*((DITH_R)-1)+1) * (R); \
- int msdg = (DITH_N*((DITH_G)-1)+1) * (G); \
- int msdb = (DITH_N*((DITH_B)-1)+1) * (B); \
- int i; \
- for (i=0;i<16;i++) { \
- int k = xmesa_kernel8[i]; \
- int j = DITH_MIX( (msdr+k)>>12, (msdg+k)>>12, (msdb+k)>>12 );\
- ditherValues[i] = (GLushort) ctable[j]; \
- } \
- }
-
-#define FLAT_DITHER_ROW_SETUP(Y) \
- GLushort *ditherRow = ditherValues + ( ((Y)&3) << 2);
-
-#define FLAT_DITHER(X) ditherRow[(X)&3]
-
-
-
-/**
- * If pixelformat==PF_LOOKUP:
- */
-#define _dither_lookup(C, c) (((unsigned)((DITH_N * (C - 1) + 1) * c)) >> 12)
-
-#define LOOKUP_SETUP \
- unsigned long *ctable = XMESA_BUFFER(ctx->DrawBuffer)->color_table
-
-#define LOOKUP( R, G, B ) \
- ctable[DITH_MIX(_dither_lookup(DITH_R, (R)), \
- _dither_lookup(DITH_G, (G)), \
- _dither_lookup(DITH_B, (B)))]
-
-
-/**
- * If pixelformat==PF_HPCR:
- *
- * HP Color Recovery dithering ([email protected] 30/08/95)
- * HP has on its 8-bit 700-series computers, a feature called
- * 'Color Recovery'. This allows near 24-bit output (so they say).
- * It is enabled by selecting the 8-bit TrueColor visual AND
- * corresponding colormap (see tkInitWindow) AND doing some special
- * dither.
- */
-extern const short xmesa_HPCR_DRGB[3][2][16];
-
-#define DITHER_HPCR( X, Y, R, G, B ) \
- ( ((xmesa->xm_visual->hpcr_rgbTbl[0][R] + xmesa_HPCR_DRGB[0][(Y)&1][(X)&15]) & 0xE0) \
- |(((xmesa->xm_visual->hpcr_rgbTbl[1][G] + xmesa_HPCR_DRGB[1][(Y)&1][(X)&15]) & 0xE0)>>3) \
- | ((xmesa->xm_visual->hpcr_rgbTbl[2][B] + xmesa_HPCR_DRGB[2][(Y)&1][(X)&15])>>6) \
- )
-
-
-
-/**
- * If pixelformat==PF_1BIT:
- */
-extern const int xmesa_kernel1[16];
-
-#define SETUP_1BIT int bitFlip = xmesa->xm_visual->bitFlip
-#define DITHER_1BIT( X, Y, R, G, B ) \
- (( ((int)(R)+(int)(G)+(int)(B)) > xmesa_kernel1[(((Y)&3) << 2) | ((X)&3)] ) ^ bitFlip)
-
-
-
-/**
- * If pixelformat==PF_GRAYSCALE:
- */
-#define GRAY_RGB( R, G, B ) XMESA_BUFFER(ctx->DrawBuffer)->color_table[((R) + (G) + (B))/3]
-
-
/**
* Converts a GL window Y coord to an X window Y coord:
@@ -453,12 +307,9 @@ extern const int xmesa_kernel1[16];
/**
- * Return the address of a 1, 2 or 4-byte pixel in the buffer's XImage:
+ * Return the address of a 2, 3 or 4-byte pixel in the buffer's XImage:
* X==0 is left, Y==0 is bottom.
*/
-#define PIXEL_ADDR1(XRB, X, Y) \
- ( (XRB)->origin1 - (Y) * (XRB)->width1 + (X) )
-
#define PIXEL_ADDR2(XRB, X, Y) \
( (XRB)->origin2 - (Y) * (XRB)->width2 + (X) )