summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorLukas Venhoda <lvenhoda@redhat.com>2015-11-25 17:14:28 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2015-12-17 16:03:19 +0100
commit2ee5cb522ee16a756c74ed6e127cf3874a45f3a6 (patch)
treeefdaffe8d310d7174d2ba04ddbd82da26a59cf3f /common
parent02c82b468c7b04452ea6c216f756775101b7a326 (diff)
downloadspice-common-2ee5cb522ee16a756c74ed6e127cf3874a45f3a6.tar.gz
spice-common-2ee5cb522ee16a756c74ed6e127cf3874a45f3a6.tar.xz
spice-common-2ee5cb522ee16a756c74ed6e127cf3874a45f3a6.zip
pixman_utils: Add macros for color byte ordering
When using image compression on PowerPC architecture, colors are in wrong order ARGB -> BGRA. This commit introduces macros, that will change the color order according to machine endianness. Theese macros are similar to QEMU macros in qemu-pixman.h
Diffstat (limited to 'common')
-rw-r--r--common/pixman_utils.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/pixman_utils.h b/common/pixman_utils.h
index dd565ef..f892777 100644
--- a/common/pixman_utils.h
+++ b/common/pixman_utils.h
@@ -27,6 +27,16 @@
#include "draw.h"
+#ifdef WORDS_BIGENDIAN
+# define PIXMAN_LE_x8r8g8b8 PIXMAN_b8g8r8x8
+# define PIXMAN_LE_a8r8g8b8 PIXMAN_b8g8r8a8
+# define PIXMAN_LE_r8g8b8 PIXMAN_b8g8r8
+#else
+# define PIXMAN_LE_x8r8g8b8 PIXMAN_x8r8g8b8
+# define PIXMAN_LE_a8r8g8b8 PIXMAN_a8r8g8b8
+# define PIXMAN_LE_r8g8b8 PIXMAN_r8g8b8
+#endif
+
SPICE_BEGIN_DECLS
/* This lists all possible 2 argument binary raster ops.