[SDL_Tizen] Fix pre-rotation 06/109106/2
authorhuiyu.eun <huiyu.eun@samsung.com>
Mon, 9 Jan 2017 01:53:22 +0000 (10:53 +0900)
committerhuiyu.eun <huiyu.eun@samsung.com>
Fri, 13 Jan 2017 03:40:55 +0000 (12:40 +0900)
- Have fixed driver issue.
Call wl_egl_window_resize() with passing parameter changed window size.

Change-Id: Ic2287440fff793644609e25887651b010deb8d8c
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/video/tizen/SDL_tizenopengles.c

index bf6fe6e..de29f13 100755 (executable)
@@ -67,19 +67,21 @@ Tizen_GLES_SwapWindow(_THIS, SDL_Window *window)
 
     if (wdata->received_rotation == 1) {
         if(wdata->support_pre_rotation) {
-            Tizen_pre_rotation_set(wdata);
-            int aw, ah;
-            wl_egl_window_get_attached_size(wdata->egl_window, &aw, &ah);
-            wl_egl_window_resize(wdata->egl_window, aw, ah, 0, 0);
-            if(wdata->rotation == 90 || wdata->rotation == 270) {
-                SDL_SetWindowSize(window, ah, aw);
-                window->w = ah;//for Fullscreen
-                window->h = aw;
-            } else {
-                SDL_SetWindowSize(window, aw, ah);//->call wl_egl_window_resize()
-                window->w = aw;//for Fullscreen
-                window->h = ah;
+            int screen_w, screen_h;
+            if(wdata->rotation==90 || wdata->rotation==270)
+                ecore_wl_screen_size_get(&screen_h, &screen_w);
+            else
+                ecore_wl_screen_size_get(&screen_w, &screen_h);
+
+            SDL_SetWindowSize(window, screen_w, screen_h);
+            if(window->flags & SDL_WINDOW_FULLSCREEN)
+            {
+                window->w = screen_w;
+                window->h = screen_h;
             }
+
+            wl_egl_window_resize(wdata->egl_window, window->w, window->h, 0, 0);
+            Tizen_pre_rotation_set(wdata);
         }
         SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SIZE_CHANGED, window->w, window->h);
         ecore_wl_window_rotation_change_done_send(wdata->window);