summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-09-17 16:31:03 -0600
committerBrian Paul <[email protected]>2011-09-20 20:17:42 -0600
commit4d53fb525db56d0695eaa5b91bd8f0cefbc25866 (patch)
treec2bb688ad1a6d0523436e4724f073f67a696c12c /src/mesa/main
parentef275f907c94be776bb5eed14ae97bfb6b537173 (diff)
mesa: move last bits of GLchan stuff into swrast
This removes the last remnants of the GLchan datatype and associated macros out of core Mesa and into swrast.
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/colormac.h75
-rw-r--r--src/mesa/main/config.h2
-rw-r--r--src/mesa/main/mtypes.h23
3 files changed, 1 insertions, 99 deletions
diff --git a/src/mesa/main/colormac.h b/src/mesa/main/colormac.h
index 46377ac7c11..0b8864a61eb 100644
--- a/src/mesa/main/colormac.h
+++ b/src/mesa/main/colormac.h
@@ -38,81 +38,6 @@
#include "mtypes.h"
-/** \def CHAN_TO_UBYTE
- * Convert from GLchan to GLubyte */
-
-/** \def CHAN_TO_FLOAT
- * Convert from GLchan to GLfloat */
-
-/** \def CLAMPED_FLOAT_TO_CHAN
- * Convert from GLclampf to GLchan */
-
-/** \def UNCLAMPED_FLOAT_TO_CHAN
- * Convert from GLfloat to GLchan */
-
-/** \def COPY_CHAN4
- * Copy a GLchan[4] array */
-
-#if CHAN_BITS == 8
-
-#define CHAN_TO_UBYTE(c) (c)
-#define CHAN_TO_USHORT(c) (((c) << 8) | (c))
-#define CHAN_TO_SHORT(c) (((c) << 7) | ((c) >> 1))
-#define CHAN_TO_FLOAT(c) UBYTE_TO_FLOAT(c)
-
-#define CLAMPED_FLOAT_TO_CHAN(c, f) CLAMPED_FLOAT_TO_UBYTE(c, f)
-#define UNCLAMPED_FLOAT_TO_CHAN(c, f) UNCLAMPED_FLOAT_TO_UBYTE(c, f)
-
-#define COPY_CHAN4(DST, SRC) COPY_4UBV(DST, SRC)
-
-#elif CHAN_BITS == 16
-
-#define CHAN_TO_UBYTE(c) ((c) >> 8)
-#define CHAN_TO_USHORT(c) (c)
-#define CHAN_TO_SHORT(c) ((c) >> 1)
-#define CHAN_TO_FLOAT(c) ((GLfloat) ((c) * (1.0 / CHAN_MAXF)))
-
-#define CLAMPED_FLOAT_TO_CHAN(c, f) CLAMPED_FLOAT_TO_USHORT(c, f)
-#define UNCLAMPED_FLOAT_TO_CHAN(c, f) UNCLAMPED_FLOAT_TO_USHORT(c, f)
-
-#define COPY_CHAN4(DST, SRC) COPY_4V(DST, SRC)
-
-#elif CHAN_BITS == 32
-
-#define CHAN_TO_UBYTE(c) FLOAT_TO_UBYTE(c)
-#define CHAN_TO_USHORT(c) ((GLushort) (CLAMP((c), 0.0f, 1.0f) * 65535.0))
-#define CHAN_TO_SHORT(c) ((GLshort) (CLAMP((c), 0.0f, 1.0f) * 32767.0))
-#define CHAN_TO_FLOAT(c) (c)
-
-#define CLAMPED_FLOAT_TO_CHAN(c, f) c = (f)
-#define UNCLAMPED_FLOAT_TO_CHAN(c, f) c = (f)
-
-#define COPY_CHAN4(DST, SRC) COPY_4V(DST, SRC)
-
-#else
-
-#error unexpected CHAN_BITS size
-
-#endif
-
-
-/**
- * Convert 4 channels at once.
- *
- * \param dst pointer to destination GLchan[4] array.
- * \param f pointer to source GLfloat[4] array.
- *
- * \sa #UNCLAMPED_FLOAT_TO_CHAN.
- */
-#define UNCLAMPED_FLOAT_TO_RGBA_CHAN(dst, f) \
-do { \
- UNCLAMPED_FLOAT_TO_CHAN((dst)[0], (f)[0]); \
- UNCLAMPED_FLOAT_TO_CHAN((dst)[1], (f)[1]); \
- UNCLAMPED_FLOAT_TO_CHAN((dst)[2], (f)[2]); \
- UNCLAMPED_FLOAT_TO_CHAN((dst)[3], (f)[3]); \
-} while (0)
-
-
/**
* Convert four float values in [0,1] to ubytes in [0,255] with clamping.
*/
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index 61b0c1681d4..7b7740ebe4f 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -332,7 +332,7 @@
/**
- * Bits per color channel: 8, 16 or 32
+ * For swrast, bits per color channel: 8, 16 or 32
*/
#ifndef CHAN_BITS
#define CHAN_BITS 8
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 3b44ec6d58f..57373a0bbbd 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -44,29 +44,6 @@
/**
- * Color channel data type.
- */
-#if CHAN_BITS == 8
- typedef GLubyte GLchan;
-#define CHAN_MAX 255
-#define CHAN_MAXF 255.0F
-#define CHAN_TYPE GL_UNSIGNED_BYTE
-#elif CHAN_BITS == 16
- typedef GLushort GLchan;
-#define CHAN_MAX 65535
-#define CHAN_MAXF 65535.0F
-#define CHAN_TYPE GL_UNSIGNED_SHORT
-#elif CHAN_BITS == 32
- typedef GLfloat GLchan;
-#define CHAN_MAX 1.0
-#define CHAN_MAXF 1.0F
-#define CHAN_TYPE GL_FLOAT
-#else
-#error "illegal number of color channel bits"
-#endif
-
-
-/**
* Stencil buffer data type.
*/
#if STENCIL_BITS==8