display: modified qemu_ds_sdl_switch func 01/18501/1
authorGiWoong Kim <giwoong.kim@samsung.com>
Mon, 17 Mar 2014 09:38:43 +0000 (18:38 +0900)
committerGiWoong Kim <giwoong.kim@samsung.com>
Tue, 25 Mar 2014 01:37:15 +0000 (10:37 +0900)
display surface must be replaced within lock period

Change-Id: Idb5215ee1f4eb4400615a04be7b627429a4394bf
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/maru_sdl.c

index efea0f4b61524484e3bee8c3590de9de225c3d57..33f6e35e4cd41d9393fed8515a23fbe06087d131 100644 (file)
@@ -234,17 +234,18 @@ static void qemu_ds_sdl_switch(DisplayChangeListener *dcl,
         return;
     }
 
-    dpy_surface = new_surface;
     console_width = surface_width(new_surface);
     console_height = surface_height(new_surface);
 
-    INFO("qemu_ds_sdl_switch : (%d, %d)\n",
-        console_width, console_height);
+    INFO("qemu_ds_sdl_switch : (%d, %d)\n", console_width, console_height);
 
 #ifdef SDL_THREAD
     pthread_mutex_lock(&sdl_mutex);
 #endif
 
+    /* switch */
+    dpy_surface = new_surface;
+
     if (surface_qemu != NULL) {
         SDL_FreeSurface(surface_qemu);
         surface_qemu = NULL;
@@ -614,7 +615,7 @@ void maruskin_sdl_interpolation(bool on)
 
 static void qemu_update(void)
 {
-    if (sdl_alteration == -1) {
+    if (sdl_alteration < 0) {
         SDL_FreeSurface(scaled_screen);
         SDL_FreeSurface(rotated_screen);
         SDL_FreeSurface(surface_qemu);