diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-15 22:17:38 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-15 22:17:38 +0000 |
commit | 6cec5487990bf3f1f22b3fcb871978255e92ae0d (patch) | |
tree | d55a89300561f11ecd680c13e686d6c23871bfe0 /vnchextile.h | |
parent | 7d957bd8cbcbf56f7916d375e65042d767f544b5 (diff) | |
download | qemu-6cec5487990bf3f1f22b3fcb871978255e92ae0d.tar.gz qemu-6cec5487990bf3f1f22b3fcb871978255e92ae0d.tar.bz2 qemu-6cec5487990bf3f1f22b3fcb871978255e92ae0d.zip |
exploiting the new interface in vnc.c (Stefano Stabellini)
This patch exploits the new DisplaySurface and PixelFormat structures in
vnc, making the code easier to read allowing further improvements.
Compared to the last version I fixed a bug that prevented the hextile
encoding from working properly.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6337 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vnchextile.h')
-rw-r--r-- | vnchextile.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/vnchextile.h b/vnchextile.h index e0a62bbb04..f3fdfb4a26 100644 --- a/vnchextile.h +++ b/vnchextile.h @@ -13,7 +13,7 @@ static void CONCAT(send_hextile_tile_, NAME)(VncState *vs, void *last_fg_, int *has_bg, int *has_fg) { - uint8_t *row = (ds_get_data(vs->ds) + y * ds_get_linesize(vs->ds) + x * vs->depth); + uint8_t *row = (ds_get_data(vs->ds) + y * ds_get_linesize(vs->ds) + x * ds_get_bytes_per_pixel(vs->ds)); pixel_t *irow = (pixel_t *)row; int j, i; pixel_t *last_bg = (pixel_t *)last_bg_; @@ -24,7 +24,7 @@ static void CONCAT(send_hextile_tile_, NAME)(VncState *vs, int bg_count = 0; int fg_count = 0; int flags = 0; - uint8_t data[(vs->pix_bpp + 2) * 16 * 16]; + uint8_t data[(vs->clientds.pf.bytes_per_pixel + 2) * 16 * 16]; int n_data = 0; int n_subtiles = 0; @@ -132,7 +132,7 @@ static void CONCAT(send_hextile_tile_, NAME)(VncState *vs, has_color = 0; #ifdef GENERIC vnc_convert_pixel(vs, data + n_data, color); - n_data += vs->pix_bpp; + n_data += vs->clientds.pf.bytes_per_pixel; #else memcpy(data + n_data, &color, sizeof(color)); n_data += sizeof(pixel_t); @@ -152,7 +152,7 @@ static void CONCAT(send_hextile_tile_, NAME)(VncState *vs, if (has_color) { #ifdef GENERIC vnc_convert_pixel(vs, data + n_data, color); - n_data += vs->pix_bpp; + n_data += vs->clientds.pf.bytes_per_pixel; #else memcpy(data + n_data, &color, sizeof(color)); n_data += sizeof(pixel_t); @@ -197,7 +197,7 @@ static void CONCAT(send_hextile_tile_, NAME)(VncState *vs, } } else { for (j = 0; j < h; j++) { - vs->write_pixels(vs, row, w * vs->depth); + vs->write_pixels(vs, row, w * ds_get_bytes_per_pixel(vs->ds)); row += ds_get_linesize(vs->ds); } } |