[Spice-devel] [spice-common PATCH 1/2] ppc: Add macros for color byte ordering
Lukas Venhoda
lvenhoda at redhat.com
Wed Jul 1 09:20:52 PDT 2015
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.
---
common/pixman_utils.h | 10 ++++++++++
1 file changed, 10 insertions(+)
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.
--
2.4.3
More information about the Spice-devel
mailing list