<div dir="ltr"><div><div><div>Self NACK<br><br></div>Wrong order of LE/BE macros<br></div>Should be the other way around:<br><br>#ifdef WORDS_BIGENDIAN<br>
#define x8r8g8b8_ALPHA 0x000000ffu<br>
#else<br>
#define x8r8g8b8_ALPHA 0xff000000u<br>
#endif<br><br></div>Will fix in next version, still some changes left.<br><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 22, 2015 at 5:02 PM, Lukas Venhoda <span dir="ltr"><<a href="mailto:lvenhoda@redhat.com" target="_blank">lvenhoda@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When checking, whether we use alpha channel, we need to compare color<br>
format with constant with the same byte order.<br>
<br>
When clearing alpha channel, we must clear in proper byte order.<br>
---<br>
Changes since v2:<br>
- Added macro for proper alpha clearing<br>
- Improved commit msg<br>
<br>
Changes since v1:<br>
- New commit<br>
---<br>
common/canvas_base.c | 12 +++++++++---<br>
1 file changed, 9 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/common/canvas_base.c b/common/canvas_base.c<br>
index 65b1c3f..1e401ed 100644<br>
--- a/common/canvas_base.c<br>
+++ b/common/canvas_base.c<br>
@@ -45,6 +45,12 @@<br>
#include "mem.h"<br>
#include "macros.h"<br>
<br>
+#ifdef WORDS_BIGENDIAN<br>
+ #define x8r8g8b8_ALPHA 0xff000000u<br>
+#else<br>
+ #define x8r8g8b8_ALPHA 0x000000ffu<br>
+#endif<br>
+<br>
#define ROUND(_x) ((int)floor((_x) + 0.5))<br>
<br>
#define IS_IMAGE_LOSSY(descriptor) \<br>
@@ -1208,12 +1214,12 @@ static pixman_image_t *canvas_get_image_internal(CanvasBase *canvas, SpiceImage<br>
#ifdef SW_CANVAS_CACHE<br>
descriptor->type != SPICE_IMAGE_TYPE_FROM_CACHE_LOSSLESS &&<br>
#endif<br>
- surface_format == PIXMAN_x8r8g8b8) {<br>
+ surface_format == PIXMAN_LE_x8r8g8b8) {<br>
spice_pixman_fill_rect_rop(surface,<br>
0, 0,<br>
pixman_image_get_width(surface),<br>
pixman_image_get_height(surface),<br>
- 0xff000000U, SPICE_ROP_OR);<br>
+ x8r8g8b8_ALPHA, SPICE_ROP_OR);<br>
}<br>
<br>
if (descriptor->flags & SPICE_IMAGE_FLAGS_CACHE_ME &&<br>
@@ -1267,7 +1273,7 @@ static pixman_image_t *canvas_get_image_internal(CanvasBase *canvas, SpiceImage<br>
If so we convert here. */<br>
<br>
wanted_format = canvas_get_target_format(canvas,<br>
- surface_format == PIXMAN_a8r8g8b8);<br>
+ surface_format == PIXMAN_LE_a8r8g8b8);<br>
<br>
if (surface_format != wanted_format) {<br>
converted = surface_create(<br>
--<br>
2.4.3<br>
<br></blockquote><div><br></div><div>Lukas Venhoda <br></div></div><br></div></div></div>