[PATCH spice-server v4] Handle top down bitmaps dumping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The top down flag can be specified using negative heights.

According to
https://msdn.microsoft.com/en-us/library/windows/desktop/dd183376(v=vs.85).aspx:

"The height of the bitmap, in pixels. If biHeight is positive, the
bitmap is a bottom-up DIB and its origin is the lower-left corner.
If biHeight is negative, the bitmap is a top-down DIB and its origin
is the upper-left corner."

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/spice-bitmap-utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Changes since v3:
- add documentation from specifications.

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);
-- 
2.7.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]