summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorEric Anholt <anholt@FreeBSD.org>2006-06-19 13:20:56 -0700
committerEric Anholt <anholt@FreeBSD.org>2006-06-19 15:11:55 -0700
commite1672a12eb70836a2ceec803d505294897ae8cd2 (patch)
treeb6fd535717c853ef99d7c385dc55681568b51ec9 /render
parent9742d55c820a260a42a4537502295931d4529deb (diff)
Convert PICT_* names from #defines to an enum to aid in debugging.
Diffstat (limited to 'render')
-rw-r--r--render/picture.h86
-rw-r--r--render/picturestr.h2
2 files changed, 45 insertions, 43 deletions
diff --git a/render/picture.h b/render/picture.h
index 778eb5c4c..e7d86ac39 100644
--- a/render/picture.h
+++ b/render/picture.h
@@ -68,61 +68,63 @@ typedef struct _Picture *PicturePtr;
#define PICT_FORMAT_COLOR(f) (PICT_FORMAT_TYPE(f) & 2)
/* 32bpp formats */
-#define PICT_a8r8g8b8 PICT_FORMAT(32,PICT_TYPE_ARGB,8,8,8,8)
-#define PICT_x8r8g8b8 PICT_FORMAT(32,PICT_TYPE_ARGB,0,8,8,8)
-#define PICT_a8b8g8r8 PICT_FORMAT(32,PICT_TYPE_ABGR,8,8,8,8)
-#define PICT_x8b8g8r8 PICT_FORMAT(32,PICT_TYPE_ABGR,0,8,8,8)
+typedef enum _PictFormatShort {
+ PICT_a8r8g8b8 = PICT_FORMAT(32,PICT_TYPE_ARGB,8,8,8,8),
+ PICT_x8r8g8b8 = PICT_FORMAT(32,PICT_TYPE_ARGB,0,8,8,8),
+ PICT_a8b8g8r8 = PICT_FORMAT(32,PICT_TYPE_ABGR,8,8,8,8),
+ PICT_x8b8g8r8 = PICT_FORMAT(32,PICT_TYPE_ABGR,0,8,8,8),
/* 24bpp formats */
-#define PICT_r8g8b8 PICT_FORMAT(24,PICT_TYPE_ARGB,0,8,8,8)
-#define PICT_b8g8r8 PICT_FORMAT(24,PICT_TYPE_ABGR,0,8,8,8)
+ PICT_r8g8b8 = PICT_FORMAT(24,PICT_TYPE_ARGB,0,8,8,8),
+ PICT_b8g8r8 = PICT_FORMAT(24,PICT_TYPE_ABGR,0,8,8,8),
/* 16bpp formats */
-#define PICT_r5g6b5 PICT_FORMAT(16,PICT_TYPE_ARGB,0,5,6,5)
-#define PICT_b5g6r5 PICT_FORMAT(16,PICT_TYPE_ABGR,0,5,6,5)
-
-#define PICT_a1r5g5b5 PICT_FORMAT(16,PICT_TYPE_ARGB,1,5,5,5)
-#define PICT_x1r5g5b5 PICT_FORMAT(16,PICT_TYPE_ARGB,0,5,5,5)
-#define PICT_a1b5g5r5 PICT_FORMAT(16,PICT_TYPE_ABGR,1,5,5,5)
-#define PICT_x1b5g5r5 PICT_FORMAT(16,PICT_TYPE_ABGR,0,5,5,5)
-#define PICT_a4r4g4b4 PICT_FORMAT(16,PICT_TYPE_ARGB,4,4,4,4)
-#define PICT_x4r4g4b4 PICT_FORMAT(16,PICT_TYPE_ARGB,0,4,4,4)
-#define PICT_a4b4g4r4 PICT_FORMAT(16,PICT_TYPE_ABGR,4,4,4,4)
-#define PICT_x4b4g4r4 PICT_FORMAT(16,PICT_TYPE_ABGR,0,4,4,4)
+ PICT_r5g6b5 = PICT_FORMAT(16,PICT_TYPE_ARGB,0,5,6,5),
+ PICT_b5g6r5 = PICT_FORMAT(16,PICT_TYPE_ABGR,0,5,6,5),
+
+ PICT_a1r5g5b5 = PICT_FORMAT(16,PICT_TYPE_ARGB,1,5,5,5),
+ PICT_x1r5g5b5 = PICT_FORMAT(16,PICT_TYPE_ARGB,0,5,5,5),
+ PICT_a1b5g5r5 = PICT_FORMAT(16,PICT_TYPE_ABGR,1,5,5,5),
+ PICT_x1b5g5r5 = PICT_FORMAT(16,PICT_TYPE_ABGR,0,5,5,5),
+ PICT_a4r4g4b4 = PICT_FORMAT(16,PICT_TYPE_ARGB,4,4,4,4),
+ PICT_x4r4g4b4 = PICT_FORMAT(16,PICT_TYPE_ARGB,0,4,4,4),
+ PICT_a4b4g4r4 = PICT_FORMAT(16,PICT_TYPE_ABGR,4,4,4,4),
+ PICT_x4b4g4r4 = PICT_FORMAT(16,PICT_TYPE_ABGR,0,4,4,4),
/* 8bpp formats */
-#define PICT_a8 PICT_FORMAT(8,PICT_TYPE_A,8,0,0,0)
-#define PICT_r3g3b2 PICT_FORMAT(8,PICT_TYPE_ARGB,0,3,3,2)
-#define PICT_b2g3r3 PICT_FORMAT(8,PICT_TYPE_ABGR,0,3,3,2)
-#define PICT_a2r2g2b2 PICT_FORMAT(8,PICT_TYPE_ARGB,2,2,2,2)
-#define PICT_a2b2g2r2 PICT_FORMAT(8,PICT_TYPE_ABGR,2,2,2,2)
-
-#define PICT_c8 PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0)
-#define PICT_g8 PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0)
-
-#define PICT_x4a4 PICT_FORMAT(8,PICT_TYPE_A,4,0,0,0)
-#define PICT_x4r1g2b1 PICT_FORMAT(8,PICT_TYPE_ARGB,0,1,2,1)
-#define PICT_x4b1g2r1 PICT_FORMAT(8,PICT_TYPE_ABGR,0,1,2,1)
-#define PICT_x4a1r1g1b1 PICT_FORMAT(8,PICT_TYPE_ARGB,1,1,1,1)
-#define PICT_x4a1b1g1r1 PICT_FORMAT(8,PICT_TYPE_ABGR,1,1,1,1)
+ PICT_a8 = PICT_FORMAT(8,PICT_TYPE_A,8,0,0,0),
+ PICT_r3g3b2 = PICT_FORMAT(8,PICT_TYPE_ARGB,0,3,3,2),
+ PICT_b2g3r3 = PICT_FORMAT(8,PICT_TYPE_ABGR,0,3,3,2),
+ PICT_a2r2g2b2 = PICT_FORMAT(8,PICT_TYPE_ARGB,2,2,2,2),
+ PICT_a2b2g2r2 = PICT_FORMAT(8,PICT_TYPE_ABGR,2,2,2,2),
+
+ PICT_c8 = PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0),
+ PICT_g8 = PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0),
+
+ PICT_x4a4 = PICT_FORMAT(8,PICT_TYPE_A,4,0,0,0),
+ PICT_x4r1g2b1 = PICT_FORMAT(8,PICT_TYPE_ARGB,0,1,2,1),
+ PICT_x4b1g2r1 = PICT_FORMAT(8,PICT_TYPE_ABGR,0,1,2,1),
+ PICT_x4a1r1g1b1 = PICT_FORMAT(8,PICT_TYPE_ARGB,1,1,1,1),
+ PICT_x4a1b1g1r1 = PICT_FORMAT(8,PICT_TYPE_ABGR,1,1,1,1),
-#define PICT_x4c4 PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0)
-#define PICT_x4g4 PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0)
+ PICT_x4c4 = PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0),
+ PICT_x4g4 = PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0),
/* 4bpp formats */
-#define PICT_a4 PICT_FORMAT(4,PICT_TYPE_A,4,0,0,0)
-#define PICT_r1g2b1 PICT_FORMAT(4,PICT_TYPE_ARGB,0,1,2,1)
-#define PICT_b1g2r1 PICT_FORMAT(4,PICT_TYPE_ABGR,0,1,2,1)
-#define PICT_a1r1g1b1 PICT_FORMAT(4,PICT_TYPE_ARGB,1,1,1,1)
-#define PICT_a1b1g1r1 PICT_FORMAT(4,PICT_TYPE_ABGR,1,1,1,1)
+ PICT_a4 = PICT_FORMAT(4,PICT_TYPE_A,4,0,0,0),
+ PICT_r1g2b1 = PICT_FORMAT(4,PICT_TYPE_ARGB,0,1,2,1),
+ PICT_b1g2r1 = PICT_FORMAT(4,PICT_TYPE_ABGR,0,1,2,1),
+ PICT_a1r1g1b1 = PICT_FORMAT(4,PICT_TYPE_ARGB,1,1,1,1),
+ PICT_a1b1g1r1 = PICT_FORMAT(4,PICT_TYPE_ABGR,1,1,1,1),
-#define PICT_c4 PICT_FORMAT(4,PICT_TYPE_COLOR,0,0,0,0)
-#define PICT_g4 PICT_FORMAT(4,PICT_TYPE_GRAY,0,0,0,0)
+ PICT_c4 = PICT_FORMAT(4,PICT_TYPE_COLOR,0,0,0,0),
+ PICT_g4 = PICT_FORMAT(4,PICT_TYPE_GRAY,0,0,0,0),
/* 1bpp formats */
-#define PICT_a1 PICT_FORMAT(1,PICT_TYPE_A,1,0,0,0)
+ PICT_a1 = PICT_FORMAT(1,PICT_TYPE_A,1,0,0,0),
-#define PICT_g1 PICT_FORMAT(1,PICT_TYPE_GRAY,0,0,0,0)
+ PICT_g1 = PICT_FORMAT(1,PICT_TYPE_GRAY,0,0,0,0),
+} PictFormatShort;
/*
* For dynamic indexed visuals (GrayScale and PseudoColor), these control the
diff --git a/render/picturestr.h b/render/picturestr.h
index e81d769d5..1ea91201e 100644
--- a/render/picturestr.h
+++ b/render/picturestr.h
@@ -129,7 +129,7 @@ typedef union _SourcePict {
typedef struct _Picture {
DrawablePtr pDrawable;
PictFormatPtr pFormat;
- CARD32 format; /* PICT_FORMAT */
+ PictFormatShort format; /* PICT_FORMAT */
int refcnt;
CARD32 id;
PicturePtr pNext; /* chain on same drawable */