[Spice-devel] [common PATCH 9/9 v4] ppc: Fix alpha state checking on BE machines
Christophe Fergeau
cfergeau at redhat.com
Fri Dec 11 05:13:17 PST 2015
On Wed, Nov 25, 2015 at 05:14:35PM +0100, Lukas Venhoda wrote:
> The surface before conversion can be either LE or BE on a BE machine.
> Check against both BE and LE color order on BE machine.
> ---
> Changes since v3:
> - Removed alpha clearing
> - The change actually broke alpha
> - Added dual color order checking
> - On BE machines it can be both ARGB and RGBA
>
> Changes since v2:
> - Added macro for proper alpha clearing
> - Improved commit msg
>
> Changes since v1:
> - New commit
> ---
> common/canvas_base.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/common/canvas_base.c b/common/canvas_base.c
> index cc87f55..937506c 100644
> --- a/common/canvas_base.c
> +++ b/common/canvas_base.c
> @@ -1271,6 +1271,9 @@ static pixman_image_t *canvas_get_image_internal(CanvasBase *canvas, SpiceImage
>
> /* On BE machines, we want to explicitly convert the surface all the time */
> wanted_format = canvas_get_target_format(canvas,
> +#ifdef WORDS_BIGENDIAN
> + surface_format == PIXMAN_b8g8r8a8 ||
> +#endif
> surface_format == PIXMAN_a8r8g8b8);
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..
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/20151211/b3a5da90/attachment.sig>
More information about the Spice-devel
mailing list