diff options
author | Gerd Hoffmann | 2013-02-28 10:48:02 +0100 |
---|---|---|
committer | Gerd Hoffmann | 2013-03-18 10:21:58 +0100 |
commit | da229ef3b3c5709b01d62e7a6e213b31bca33d16 (patch) | |
tree | d65f6542018ca23e0a752f34b50f91857103a4e2 /hw/vga.c | |
parent | sdl: drop dead code (diff) | |
download | qemu-da229ef3b3c5709b01d62e7a6e213b31bca33d16.tar.gz qemu-da229ef3b3c5709b01d62e7a6e213b31bca33d16.tar.xz qemu-da229ef3b3c5709b01d62e7a6e213b31bca33d16.zip |
console: rework DisplaySurface handling [vga emu side]
Decouple DisplaySurface allocation & deallocation from DisplayState.
Replace dpy_gfx_resize + dpy_gfx_setdata with a dpy_gfx_replace_surface
function.
This handles the graphic hardware emulation.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/vga.c')
-rw-r--r-- | hw/vga.c | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -1691,11 +1691,11 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) height != s->last_height || s->last_depth != depth) { if (depth == 32 || (depth == 16 && !byteswap)) { - qemu_free_displaysurface(s->ds); - s->ds->surface = qemu_create_displaysurface_from(disp_width, height, depth, - s->line_offset, + DisplaySurface *surface; + surface = qemu_create_displaysurface_from(disp_width, + height, depth, s->line_offset, s->vram_ptr + (s->start_addr * 4), byteswap); - dpy_gfx_resize(s->ds); + dpy_gfx_replace_surface(s->ds, surface); } else { qemu_console_resize(s->ds, disp_width, height); } @@ -1709,12 +1709,11 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) } else if (is_buffer_shared(s->ds->surface) && (full_update || ds_get_data(s->ds) != s->vram_ptr + (s->start_addr * 4))) { - qemu_free_displaysurface(s->ds); - s->ds->surface = qemu_create_displaysurface_from(disp_width, - height, depth, - s->line_offset, + DisplaySurface *surface; + surface = qemu_create_displaysurface_from(disp_width, + height, depth, s->line_offset, s->vram_ptr + (s->start_addr * 4), byteswap); - dpy_gfx_setdata(s->ds); + dpy_gfx_replace_surface(s->ds, surface); } s->rgb_to_pixel = |