[Spice-devel] [PATCH spice-server v3 1/5] Handle top down bitmaps dumping

Jonathon Jongsma jjongsma at redhat.com
Thu Nov 10 21:58:03 UTC 2016


On Wed, 2016-11-09 at 10:19 +0000, Frediano Ziglio wrote:
> The top down flag can be specified using negative heights.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/spice-bitmap-utils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/server/spice-bitmap-utils.c b/server/spice-bitmap-
> utils.c
> index 72a9285..439f05d 100644
> --- a/server/spice-bitmap-utils.c
> +++ b/server/spice-bitmap-utils.c
> @@ -269,7 +269,7 @@ void dump_bitmap(SpiceBitmap *bitmap)
>      put_32le(&ptr, bitmap_data_offset);
>      put_32le(&ptr, header_size - 14);
>      put_32le(&ptr, bitmap->x);
> -    put_32le(&ptr, bitmap->y);
> +    put_32le(&ptr, bitmap->flags & SPICE_BITMAP_FLAGS_TOP_DOWN ?
> -bitmap->y : bitmap->y);
>  
>      put_16le(&ptr, 1); // plane
>      put_16le(&ptr, n_pixel_bits);

I'm certainly no expert on bitmap formats. But according to
wikipedia[1], top-down bitmaps should have a negative height. Assuming
that's correct, this patch looks OK to me. 

Acked-by: Jonathon Jongsma <jjongsma at redhat.com>


[1] https://en.wikipedia.org/wiki/BMP_file_format




More information about the Spice-devel mailing list