Commit d2a0102a4c653b0cbb357445409c2cc1f6653501

Authored by aliguori
1 parent 89064286

Move the framebuffer update package out (Alexander Graf)

Currently the send_framebuffer_update_raw and send_framebuffer_update_hextile
respectively send a send_framebuffer_update packet themselves. We need to reuse
send_framebuffer_update_raw for zlib encoding though, so let's move it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6498 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 2 additions and 4 deletions
... ... @@ -417,8 +417,6 @@ static void send_framebuffer_update_raw(VncState *vs, int x, int y, int w, int h
417 417 int i;
418 418 uint8_t *row;
419 419  
420   - vnc_framebuffer_update(vs, x, y, w, h, VNC_ENCODING_RAW);
421   -
422 420 row = ds_get_data(vs->ds) + y * ds_get_linesize(vs->ds) + x * ds_get_bytes_per_pixel(vs->ds);
423 421 for (i = 0; i < h; i++) {
424 422 vs->write_pixels(vs, row, w * ds_get_bytes_per_pixel(vs->ds));
... ... @@ -468,8 +466,6 @@ static void send_framebuffer_update_hextile(VncState *vs, int x, int y, int w, i
468 466 int has_fg, has_bg;
469 467 uint8_t *last_fg, *last_bg;
470 468  
471   - vnc_framebuffer_update(vs, x, y, w, h, VNC_ENCODING_HEXTILE);
472   -
473 469 last_fg = (uint8_t *) malloc(vs->serverds.pf.bytes_per_pixel);
474 470 last_bg = (uint8_t *) malloc(vs->serverds.pf.bytes_per_pixel);
475 471 has_fg = has_bg = 0;
... ... @@ -489,9 +485,11 @@ static void send_framebuffer_update(VncState *vs, int x, int y, int w, int h)
489 485 {
490 486 switch(vs->vnc_encoding) {
491 487 case VNC_ENCODING_HEXTILE:
  488 + vnc_framebuffer_update(vs, x, y, w, h, VNC_ENCODING_HEXTILE);
492 489 send_framebuffer_update_hextile(vs, x, y, w, h);
493 490 break;
494 491 default:
  492 + vnc_framebuffer_update(vs, x, y, w, h, VNC_ENCODING_RAW);
495 493 send_framebuffer_update_raw(vs, x, y, w, h);
496 494 break;
497 495 }
... ...