<div dir="ltr">Hi<br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 11, 2015 at 2:13 PM, Christophe Fergeau <span dir="ltr"><<a href="mailto:cfergeau@redhat.com" target="_blank">cfergeau@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">canvas_get_target_format() then has this code:<br>
<br>
if (source_has_alpha) {<br>
if (format == PIXMAN_x8r8g8b8) {<br>
format = PIXMAN_a8r8g8b8;<br>
}<br>
}<br>
<br>
spice_surface_format_to_pixman(canvas::format) is not going to return<br>
PIXMAN_b8g8r8x8 on big-endian, is the canvas in a8r8g8b8 format on BE too?<br>
If yes, then this patch should be correct, if not, more work will be needed I'm afraid..<span class=""><font color="#888888"><br></font></span></blockquote></div><br>
spice_surface_format_to_pixman(canvas->format) will always return LE order colors (ARGB, XRGB).<br></div><div class="gmail_extra">With that, this function will also always return LE order colors, and that is correct behavior.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">What the patch does is that it ensures, that source_has_alpha is set correctly,<br>because surface_format can be both BE, or LE.<br></div><div class="gmail_extra"><br>If it is BE we will always convert to LE (surface_format != wanted_format will always fail),<br>but we can also convert from alpha to non-alpha or vice versa.<br></div><div class="gmail_extra"><br>If it is LE we will only convert, if the alpha needs to be converted<br>(surface_format != wanted_format will fail only when alpha is different)<br><br></div><div class="gmail_extra">Hope that answers your question.<br></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature">Lukas Venhoda</div>
</div></div>