[Spice-devel] [spice-gtk PATCH 4/4 v4] ppc: Fix spicy-screenshot colors on BE machines
Lukas Venhoda
lvenhoda at redhat.com
Thu Dec 17 07:50:19 PST 2015
Save screenshot in proper endianess
xRGB on LE machine and BGRx on BE machine
---
Changes since v3:
- New patch
---
src/spicy-screenshot.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/spicy-screenshot.c b/src/spicy-screenshot.c
index d90d4e8..63666d6 100644
--- a/src/spicy-screenshot.c
+++ b/src/spicy-screenshot.c
@@ -63,9 +63,15 @@ static int write_ppm_32(void)
n = d_width * d_height;
p = d_data;
while (n > 0) {
+#ifdef WORDS_BIGENDIAN
+ fputc(p[1], fp);
+ fputc(p[2], fp);
+ fputc(p[3], fp);
+#else
fputc(p[2], fp);
fputc(p[1], fp);
fputc(p[0], fp);
+#endif
p += 4;
n--;
}
--
2.5.0
More information about the Spice-devel
mailing list