[Spice-devel] [common PATCH 9/9 v4] ppc: Fix alpha state checking on BE machines
Christophe Fergeau
cfergeau at redhat.com
Thu Dec 17 04:15:59 PST 2015
On Thu, Dec 17, 2015 at 12:33:37PM +0100, Lukas Venhoda wrote:
> Hi
>
> On Fri, Dec 11, 2015 at 2:13 PM, Christophe Fergeau <cfergeau at redhat.com>
> wrote:
>
> > canvas_get_target_format() then has this code:
> >
> > if (source_has_alpha) {
> > if (format == PIXMAN_x8r8g8b8) {
> > format = PIXMAN_a8r8g8b8;
> > }
> > }
> >
> > spice_surface_format_to_pixman(canvas::format) is not going to return
> > PIXMAN_b8g8r8x8 on big-endian, is the canvas in a8r8g8b8 format on BE too?
> > If yes, then this patch should be correct, if not, more work will be
> > needed I'm afraid..
> >
>
> spice_surface_format_to_pixman(canvas->format) will always return LE order
> colors (ARGB, XRGB).
> With that, this function will also always return LE order colors, and that
> is correct behavior.
>
> What the patch does is that it ensures, that source_has_alpha is set
> correctly,
> because surface_format can be both BE, or LE.
>
> If it is BE we will always convert to LE (surface_format != wanted_format
> will always fail),
> but we can also convert from alpha to non-alpha or vice versa.
>
> If it is LE we will only convert, if the alpha needs to be converted
> (surface_format != wanted_format will fail only when alpha is different)
>
> Hope that answers your question.
Yes, thanks.
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20151217/5b72ac22/attachment.sig>
More information about the Spice-devel
mailing list