summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2010-02-11 00:29:56 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2010-02-19 15:18:16 -0600
commit9441987446d204910a7707272c0f3a7d17f9830c (patch)
treed30cf0489d9c08f7183d2033402e09ddd521b985
parentb473df6e6a95fac7b58dc2282c0388e370c2fd70 (diff)
downloadfocaccia-qemu-9441987446d204910a7707272c0f3a7d17f9830c.tar.gz
focaccia-qemu-9441987446d204910a7707272c0f3a7d17f9830c.zip
remove knowledge of defaultallocator_free_displaysurface from sdl.c
Let register_displayallocator hand over the old width/height to the new
allocator.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--sdl.c4
-rw-r--r--vl.c8
2 files changed, 7 insertions, 5 deletions
diff --git a/sdl.c b/sdl.c
index cf27ad2c14..a9b4323900 100644
--- a/sdl.c
+++ b/sdl.c
@@ -872,10 +872,6 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
     da->resize_displaysurface = sdl_resize_displaysurface;
     da->free_displaysurface = sdl_free_displaysurface;
     if (register_displayallocator(ds, da) == da) {
-        DisplaySurface *surf;
-        surf = sdl_create_displaysurface(ds_get_width(ds), ds_get_height(ds));
-        defaultallocator_free_displaysurface(ds->surface);
-        ds->surface = surf;
         dpy_resize(ds);
     }
 
diff --git a/vl.c b/vl.c
index bfbd0afc73..599a0803d7 100644
--- a/vl.c
+++ b/vl.c
@@ -2615,7 +2615,13 @@ DisplayState *get_displaystate(void)
 
 DisplayAllocator *register_displayallocator(DisplayState *ds, DisplayAllocator *da)
 {
-    if(ds->allocator ==  &default_allocator) ds->allocator = da;
+    if(ds->allocator ==  &default_allocator) {
+        DisplaySurface *surf;
+        surf = da->create_displaysurface(ds_get_width(ds), ds_get_height(ds));
+        defaultallocator_free_displaysurface(ds->surface);
+        ds->surface = surf;
+        ds->allocator = da;
+    }
     return ds->allocator;
 }