summaryrefslogtreecommitdiff
path: root/src/amd_blend.h
blob: 6748ec064fe138660f31f337042439a61c7e15d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef AMD_BLEND_H_
#define AMD_BLEND_H_

#define GEODEPTR_FROM_PIXMAP(x)		\
		GEODEPTR(xf86Screens[(x)->drawable.pScreen->myNum])
#define GEODEPTR_FROM_SCREEN(x)		\
		GEODEPTR(xf86Screens[(x)->myNum])
#define GEODEPTR_FROM_PICTURE(x)	\
		GEODEPTR(xf86Screens[(x)->pDrawable->pScreen->myNum])

#define usesPasses(op) (((		\
   ( 1 << PictOpAtop ) | 		\
   ( 1 << PictOpAtopReverse ) | \
   ( 1 << PictOpXor ) | 		\
   0 ) >> (op)) & 1)

/* pass1 or pass2 */
#define usesSrcAlpha(op) ((( 		\
   ( 1 << PictOpOver ) | 			\
   ( 1 << PictOpInReverse  ) | 		\
   ( 1 << PictOpOutReverse  ) | 	\
   ( 1 << PictOpAtop ) | 			\
   ( 1 << PictOpAtopReverse ) | 	\
   ( 1 << PictOpXor ) | 			\
   0 ) >> (op)) & 1)

/* pass1 or pass2 */
#define usesDstAlpha(op) ((( 		\
   ( 1 << PictOpOverReverse ) | 	\
   ( 1 << PictOpIn ) | 				\
   ( 1 << PictOpOut ) | 			\
   ( 1 << PictOpAtop ) | 			\
   ( 1 << PictOpAtopReverse ) | 	\
   ( 1 << PictOpXor ) | 			\
   0 ) >> (op)) & 1)

/* non 2 pass ops */
#define usesChanB0(op) ((( 			\
   ( 1 << PictOpOver ) | 			\
   ( 1 << PictOpOverReverse ) | 	\
   ( 1 << PictOpIn ) | 				\
   ( 1 << PictOpInReverse ) | 		\
   ( 1 << PictOpOut ) | 			\
   ( 1 << PictOpOutReverse ) | 		\
   ( 1 << PictOpAdd ) | 			\
   0 ) >> (op)) & 1)

/* pass 1 ops */
#define usesChanB1(op) ((( 			\
   ( 1 << PictOpAtop ) | 			\
   ( 1 << PictOpAtopReverse ) | 	\
   ( 1 << PictOpXor ) | 			\
   0 ) >> (op)) & 1)

/* pass 2 ops */
#define usesChanB2(op) ((( 			\
   ( 1 << PictOpAtop ) | 			\
   ( 1 << PictOpAtopReverse ) | 	\
   ( 1 << PictOpXor ) | 			\
   0 ) >> (op)) & 1)

#endif