Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NfM0b-0008M3-9o for qemu-devel@nongnu.org; Wed, 10 Feb 2010 18:30:13 -0500 Received: from [199.232.76.173] (port=46823 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NfM0a-0008Le-Uf for qemu-devel@nongnu.org; Wed, 10 Feb 2010 18:30:12 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NfM0a-0004Ox-2P for qemu-devel@nongnu.org; Wed, 10 Feb 2010 18:30:12 -0500 Received: from mail-fx0-f223.google.com ([209.85.220.223]:41687) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NfM0Z-0004Op-Mh for qemu-devel@nongnu.org; Wed, 10 Feb 2010 18:30:11 -0500 Received: by fxm23 with SMTP id 23so607174fxm.2 for ; Wed, 10 Feb 2010 15:30:10 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 11 Feb 2010 00:29:56 +0100 Message-Id: <1265844597-29941-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1265844597-29941-1-git-send-email-pbonzini@redhat.com> References: <1265844597-29941-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 2/3] remove knowledge of defaultallocator_free_displaysurface from sdl.c List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Let register_displayallocator hand over the old width/height to the new allocator. Signed-off-by: Paolo Bonzini --- So these functions will be made static when moved to console.c. sdl.c | 4 ---- vl.c | 8 +++++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sdl.c b/sdl.c index cf27ad2..a9b4323 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 94aeb5e..8e8b4d1 100644 --- a/vl.c +++ b/vl.c @@ -2598,7 +2598,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; } -- 1.6.6