[spice-common PATCH 1/2] ppc: Add macros for color byte ordering

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]