From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 2/3] remove knowledge of defaultallocator_free_displaysurface from sdl.c
Date: Thu, 11 Feb 2010 00:29:56 +0100 [thread overview]
Message-ID: <1265844597-29941-3-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1265844597-29941-1-git-send-email-pbonzini@redhat.com>
Let register_displayallocator hand over the old width/height to the new
allocator.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
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
next prev parent reply other threads:[~2010-02-10 23:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-10 23:29 [Qemu-devel] [PATCH 0/3] move stuff out from vl.c to console.c Paolo Bonzini
2010-02-10 23:29 ` [Qemu-devel] [PATCH 1/3] use lazy initialization for display_state Paolo Bonzini
2010-02-19 21:28 ` Anthony Liguori
2010-02-10 23:29 ` Paolo Bonzini [this message]
2010-02-10 23:29 ` [Qemu-devel] [PATCH 3/3] move default allocator to console.c Paolo Bonzini
2010-02-11 2:10 ` [Qemu-devel] [PATCH 0/3] move stuff out from vl.c " Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1265844597-29941-3-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).