summaryrefslogtreecommitdiff
path: root/src/geode_blend.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/geode_blend.h')
-rw-r--r--src/geode_blend.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/geode_blend.h b/src/geode_blend.h
new file mode 100644
index 0000000..6748ec0
--- /dev/null
+++ b/src/geode_blend.h
@@ -0,0 +1,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