提交 d2a0102a 编写于 作者: A aliguori

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: NAlexander Graf <agraf@suse.de>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6498 c046a42c-6fe2-441c-8c8c-71466251a162
上级 89064286
...@@ -417,8 +417,6 @@ static void send_framebuffer_update_raw(VncState *vs, int x, int y, int w, int h ...@@ -417,8 +417,6 @@ static void send_framebuffer_update_raw(VncState *vs, int x, int y, int w, int h
int i; int i;
uint8_t *row; uint8_t *row;
vnc_framebuffer_update(vs, x, y, w, h, VNC_ENCODING_RAW);
row = ds_get_data(vs->ds) + y * ds_get_linesize(vs->ds) + x * ds_get_bytes_per_pixel(vs->ds); row = ds_get_data(vs->ds) + y * ds_get_linesize(vs->ds) + x * ds_get_bytes_per_pixel(vs->ds);
for (i = 0; i < h; i++) { for (i = 0; i < h; i++) {
vs->write_pixels(vs, row, w * ds_get_bytes_per_pixel(vs->ds)); 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,8 +466,6 @@ static void send_framebuffer_update_hextile(VncState *vs, int x, int y, int w, i
int has_fg, has_bg; int has_fg, has_bg;
uint8_t *last_fg, *last_bg; uint8_t *last_fg, *last_bg;
vnc_framebuffer_update(vs, x, y, w, h, VNC_ENCODING_HEXTILE);
last_fg = (uint8_t *) malloc(vs->serverds.pf.bytes_per_pixel); last_fg = (uint8_t *) malloc(vs->serverds.pf.bytes_per_pixel);
last_bg = (uint8_t *) malloc(vs->serverds.pf.bytes_per_pixel); last_bg = (uint8_t *) malloc(vs->serverds.pf.bytes_per_pixel);
has_fg = has_bg = 0; 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,9 +485,11 @@ static void send_framebuffer_update(VncState *vs, int x, int y, int w, int h)
{ {
switch(vs->vnc_encoding) { switch(vs->vnc_encoding) {
case VNC_ENCODING_HEXTILE: case VNC_ENCODING_HEXTILE:
vnc_framebuffer_update(vs, x, y, w, h, VNC_ENCODING_HEXTILE);
send_framebuffer_update_hextile(vs, x, y, w, h); send_framebuffer_update_hextile(vs, x, y, w, h);
break; break;
default: default:
vnc_framebuffer_update(vs, x, y, w, h, VNC_ENCODING_RAW);
send_framebuffer_update_raw(vs, x, y, w, h); send_framebuffer_update_raw(vs, x, y, w, h);
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册