提交 94419874 编写于 作者: P Paolo Bonzini 提交者: Anthony Liguori

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: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 b473df6e
......@@ -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);
}
......
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册