X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=vnchextile.h;h=f5b6fcb55e161250d8dceefa97d882ae7569d0f1;hb=4495d6a74575b4ee7e9aabdc66e67b6c9e19a698;hp=aa575b7df8affabb7ade6bb8cb878d7e05fd5ee0;hpb=92190c648a0b34a46061dce5cf056a125ede731b;p=qemu diff --git a/vnchextile.h b/vnchextile.h index aa575b7..f5b6fcb 100644 --- a/vnchextile.h +++ b/vnchextile.h @@ -2,29 +2,29 @@ #define CONCAT(a, b) CONCAT_I(a, b) #define pixel_t CONCAT(uint, CONCAT(BPP, _t)) #ifdef GENERIC -#define NAME generic +#define NAME CONCAT(generic_, BPP) #else #define NAME BPP #endif static void CONCAT(send_hextile_tile_, NAME)(VncState *vs, int x, int y, int w, int h, - uint32_t *last_bg32, - uint32_t *last_fg32, + void *last_bg_, + void *last_fg_, int *has_bg, int *has_fg) { - char *row = (vs->ds->data + y * vs->ds->linesize + x * vs->depth); + uint8_t *row = vs->server.ds->data + 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_bg32; - pixel_t *last_fg = (pixel_t *)last_fg32; + pixel_t *last_bg = (pixel_t *)last_bg_; + pixel_t *last_fg = (pixel_t *)last_fg_; pixel_t bg = 0; pixel_t fg = 0; int n_colors = 0; int bg_count = 0; int fg_count = 0; int flags = 0; - uint8_t data[(sizeof(pixel_t) + 2) * 16 * 16]; + uint8_t data[(vs->clientds.pf.bytes_per_pixel + 2) * 16 * 16]; int n_data = 0; int n_subtiles = 0; @@ -57,7 +57,7 @@ static void CONCAT(send_hextile_tile_, NAME)(VncState *vs, } if (n_colors > 2) break; - irow += vs->ds->linesize / sizeof(pixel_t); + irow += ds_get_linesize(vs->ds) / sizeof(pixel_t); } if (n_colors > 1 && fg_count > bg_count) { @@ -86,7 +86,7 @@ static void CONCAT(send_hextile_tile_, NAME)(VncState *vs, flags |= 0x08; irow = (pixel_t *)row; - + for (j = 0; j < h; j++) { int min_x = -1; for (i = 0; i < w; i++) { @@ -105,7 +105,7 @@ static void CONCAT(send_hextile_tile_, NAME)(VncState *vs, n_data += 2; n_subtiles++; } - irow += vs->ds->linesize / sizeof(pixel_t); + irow += ds_get_linesize(vs->ds) / sizeof(pixel_t); } break; case 3: @@ -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); @@ -161,7 +161,7 @@ static void CONCAT(send_hextile_tile_, NAME)(VncState *vs, n_data += 2; n_subtiles++; } - irow += vs->ds->linesize / sizeof(pixel_t); + irow += ds_get_linesize(vs->ds) / sizeof(pixel_t); } /* A SubrectsColoured subtile invalidates the foreground color */ @@ -197,8 +197,8 @@ static void CONCAT(send_hextile_tile_, NAME)(VncState *vs, } } else { for (j = 0; j < h; j++) { - vs->write_pixels(vs, row, w * vs->depth); - row += vs->ds->linesize; + vs->write_pixels(vs, row, w * ds_get_bytes_per_pixel(vs->ds)); + row += ds_get_linesize(vs->ds); } } }