summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorSoren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com>2007-05-15 17:59:13 -0400
committerSoren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com>2007-05-15 17:59:13 -0400
commit0fcd17c9181901c419cc32bc24c07fe5a6934d81 (patch)
treef8b21356027e1ab59bcea7400d75c911ab64ca74 /render
parentf4c1d5fc28a5a7fe2592505350f9e2331f6049b7 (diff)
Use pixman short formats, revert the gradient_stop change
Diffstat (limited to 'render')
-rw-r--r--render/picture.h109
-rw-r--r--render/picturestr.h5
2 files changed, 56 insertions, 58 deletions
diff --git a/render/picture.h b/render/picture.h
index fc5038789..1719587a5 100644
--- a/render/picture.h
+++ b/render/picture.h
@@ -36,12 +36,7 @@ typedef struct _Picture *PicturePtr;
* sample implementation allows only packed RGB and GBR
* representations for data to simplify software rendering,
*/
-#define PICT_FORMAT(bpp,type,a,r,g,b) (((bpp) << 24) | \
- ((type) << 16) | \
- ((a) << 12) | \
- ((r) << 8) | \
- ((g) << 4) | \
- ((b)))
+#define PICT_FORMAT(bpp,type,a,r,g,b) PIXMAN_FORMAT(bpp, type, a, r, g, b)
/*
* gray/color formats use a visual index instead of argb
@@ -50,77 +45,77 @@ typedef struct _Picture *PicturePtr;
((type) << 16) | \
((vi)))
-#define PICT_FORMAT_BPP(f) (((f) >> 24) )
-#define PICT_FORMAT_TYPE(f) (((f) >> 16) & 0xff)
-#define PICT_FORMAT_A(f) (((f) >> 12) & 0x0f)
-#define PICT_FORMAT_R(f) (((f) >> 8) & 0x0f)
-#define PICT_FORMAT_G(f) (((f) >> 4) & 0x0f)
-#define PICT_FORMAT_B(f) (((f) ) & 0x0f)
-#define PICT_FORMAT_RGB(f) (((f) ) & 0xfff)
-#define PICT_FORMAT_VIS(f) (((f) ) & 0xffff)
+#define PICT_FORMAT_BPP(f) PIXMAN_FORMAT_BPP(f)
+#define PICT_FORMAT_TYPE(f) PIXMAN_FORMAT_TYPE(f)
+#define PICT_FORMAT_A(f) PIXMAN_FORMAT_A(f)
+#define PICT_FORMAT_R(f) PIXMAN_FORMAT_R(f)
+#define PICT_FORMAT_G(f) PIXMAN_FORMAT_G(f)
+#define PICT_FORMAT_B(f) PIXMAN_FORMAT_B(f)
+#define PICT_FORMAT_RGB(f) PIXMAN_FORMAT_RGB(f)
+#define PICT_FORMAT_VIS(f) PIXMAN_FORMAT_VIS(f)
-#define PICT_TYPE_OTHER 0
-#define PICT_TYPE_A 1
-#define PICT_TYPE_ARGB 2
-#define PICT_TYPE_ABGR 3
-#define PICT_TYPE_COLOR 4
-#define PICT_TYPE_GRAY 5
+#define PICT_TYPE_OTHER PIXMAN_TYPE_OTHER
+#define PICT_TYPE_A PIXMAN_TYPE_A
+#define PICT_TYPE_ARGB PIXMAN_TYPE_ARGB
+#define PICT_TYPE_ABGR PIXMAN_TYPE_ABGR
+#define PICT_TYPE_COLOR PIXMAN_TYPE_COLOR
+#define PICT_TYPE_GRAY PIXMAN_TYPE_GRAY
-#define PICT_FORMAT_COLOR(f) (PICT_FORMAT_TYPE(f) & 2)
+#define PICT_FORMAT_COLOR(f) PIXMAN_FORMAT_COLOR(f)
/* 32bpp formats */
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),
+ PICT_a8r8g8b8 = PIXMAN_a8r8g8b8,
+ PICT_x8r8g8b8 = PIXMAN_x8r8g8b8,
+ PICT_a8b8g8r8 = PIXMAN_a8b8g8r8,
+ PICT_x8b8g8r8 = PIXMAN_x8b8g8r8,
/* 24bpp formats */
- PICT_r8g8b8 = PICT_FORMAT(24,PICT_TYPE_ARGB,0,8,8,8),
- PICT_b8g8r8 = PICT_FORMAT(24,PICT_TYPE_ABGR,0,8,8,8),
+ PICT_r8g8b8 = PIXMAN_r8g8b8,
+ PICT_b8g8r8 = PIXMAN_b8g8r8,
/* 16bpp formats */
- 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),
+ PICT_r5g6b5 = PIXMAN_r5g6b5,
+ PICT_b5g6r5 = PIXMAN_b5g6r5,
+
+ PICT_a1r5g5b5 = PIXMAN_a1r5g5b5,
+ PICT_x1r5g5b5 = PIXMAN_x1r5g5b5,
+ PICT_a1b5g5r5 = PIXMAN_a1b5g5r5,
+ PICT_x1b5g5r5 = PIXMAN_x1b5g5r5,
+ PICT_a4r4g4b4 = PIXMAN_a4r4g4b4,
+ PICT_x4r4g4b4 = PIXMAN_x4r4g4b4,
+ PICT_a4b4g4r4 = PIXMAN_a4b4g4r4,
+ PICT_x4b4g4r4 = PIXMAN_x4b4g4r4,
/* 8bpp formats */
- 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_a8 = PIXMAN_a8,
+ PICT_r3g3b2 = PIXMAN_r3g3b2,
+ PICT_b2g3r3 = PIXMAN_b2g3r3,
+ PICT_a2r2g2b2 = PIXMAN_a2r2g2b2,
+ PICT_a2b2g2r2 = PIXMAN_a2b2g2r2,
- 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_c8 = PIXMAN_c8,
+ PICT_g8 = PIXMAN_g8,
- PICT_x4a4 = PICT_FORMAT(8,PICT_TYPE_A,4,0,0,0),
+ PICT_x4a4 = PIXMAN_x4a4,
- PICT_x4c4 = PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0),
- PICT_x4g4 = PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0),
+ PICT_x4c4 = PIXMAN_x4c4,
+ PICT_x4g4 = PIXMAN_x4g4,
/* 4bpp formats */
- 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),
+ PICT_a4 = PIXMAN_a4,
+ PICT_r1g2b1 = PIXMAN_r1g2b1,
+ PICT_b1g2r1 = PIXMAN_b1g2r1,
+ PICT_a1r1g1b1 = PIXMAN_a1r1g1b1,
+ PICT_a1b1g1r1 = PIXMAN_a1b1g1r1,
- PICT_c4 = PICT_FORMAT(4,PICT_TYPE_COLOR,0,0,0,0),
- PICT_g4 = PICT_FORMAT(4,PICT_TYPE_GRAY,0,0,0,0),
+ PICT_c4 = PIXMAN_c4,
+ PICT_g4 = PIXMAN_g4,
/* 1bpp formats */
- PICT_a1 = PICT_FORMAT(1,PICT_TYPE_A,1,0,0,0),
+ PICT_a1 = PIXMAN_a1,
- PICT_g1 = PICT_FORMAT(1,PICT_TYPE_GRAY,0,0,0,0),
+ PICT_g1 = PIXMAN_g1,
} PictFormatShort;
/*
diff --git a/render/picturestr.h b/render/picturestr.h
index 9259cad99..9c41fc1f2 100644
--- a/render/picturestr.h
+++ b/render/picturestr.h
@@ -73,7 +73,10 @@ typedef struct _PictSolidFill {
CARD32 color;
} PictSolidFill, *PictSolidFillPtr;
-typedef struct pixman_gradient_stop PictGradientStop, *PictGradientStopPtr;
+typedef struct _PictGradientStop {
+ xFixed x;
+ xRenderColor color;
+} PictGradientStop, *PictGradientStopPtr;
typedef struct _PictGradient {
unsigned int type;