exploiting the new interface in vnc.c
PATCH 1/1 exploiting the new interface in vnc.c
Import "exploiting the new interface in vnc.c" from qemu mainstream.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6337 c046a42c-6fe2-441c-8c8c-71466251a162
Signed-off-by Stefano Stabellini <[email protected]>
---
console.c +17 -0
@@ -1310,6 +1310,9 @@ pf.rshift =0 ; pf.gshift =8 ; pf.bshift =16 ; + pf.rbits =8 ; + pf.gbits =8 ; + pf.bbits =8 ;break ;case 32 : pf.rmask =0x0000FF00 ;
@@ -1324,6 +1327,10 @@ pf.rshift =8 ; pf.gshift =16 ; pf.bshift =24 ; + pf.rbits =8 ; + pf.gbits =8 ; + pf.bbits =8 ; + pf.abits =8 ;break ;default :break ;
@@ -1352,6 +1359,9 @@ pf.rshift =11 ; pf.gshift =5 ; pf.bshift =0 ; + pf.rbits =5 ; + pf.gbits =6 ; + pf.bbits =5 ;break ;case 24 : pf.rmask =0x00FF0000 ;
@@ -1363,6 +1373,9 @@ pf.rshift =16 ; pf.gshift =8 ; pf.bshift =0 ; + pf.rbits =8 ; + pf.gbits =8 ; + pf.bbits =8 ;case 32 : pf.rmask =0x00FF0000 ; pf.gmask =0x0000FF00 ;
@@ -1375,6 +1388,10 @@ pf.rshift =16 ; pf.gshift =8 ; pf.bshift =0 ; + pf.rbits =8 ; + pf.gbits =8 ; + pf.bbits =8 ; + pf.abits =8 ;break ;default :break ;
console.h +1 -0
@@ -77,6 +77,7 @@uint32_t rmask, gmask, bmask, amask;uint8_t rshift, gshift, bshift, ashift;uint8_t rmax, gmax, bmax, amax; +uint8_t rbits, gbits, bbits, abits; };struct DisplaySurface {
vnc.c +125 -203
481 lines not on this page · raw message
vnchextile.h +5 -5
@@ -13,7 +13,7 @@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 @@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 @@ 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 @@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 @@ } }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); } }