[SDL_Tizen] If doesn't support prerotation, window is composite mode 95/133095/1
authorhuiyu.eun <huiyu.eun@samsung.com>
Fri, 9 Jun 2017 02:12:55 +0000 (11:12 +0900)
committerhuiyu.eun <huiyu.eun@samsung.com>
Fri, 9 Jun 2017 02:17:52 +0000 (11:17 +0900)
 window is 'composite' mode
1) In case of using screen rotation.
2) If doesn't support prerotation.

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

index d34fb4e..2fc3ce7 100755 (executable)
@@ -401,7 +401,7 @@ _tizen_rotation_do(SDL_WindowData *wind, int rotation)
     if(wind->support_pre_rotation)
         Tizen_pre_rotation_set(wind, rotation);
 
-    _tizen_send_rotation_event(window, rotation);
+    _tizen_send_rotation_event(window, wind->rotation);
     SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SIZE_CHANGED, window->w, window->h);
     wind->received_rotation = 1;
 
@@ -425,7 +425,9 @@ _tizen_rotate_update(SDL_WindowData *wind)
 
     //Set Screen Rotation
     wind->output_rotation = screen_rotation;
-    ecore_wl_window_buffer_transform_set(wind->window, wind->output_rotation / 90);
+
+    if(wind->support_pre_rotation)
+        ecore_wl_window_buffer_transform_set(wind->window, wind->output_rotation / 90);
 
     int rotation = (wind->output_rotation + wind->rotation) % 360;
     _tizen_rotation_do(wind, rotation);
@@ -500,6 +502,7 @@ Tizen_CreateWindow(_THIS, SDL_Window *window)
 
 #if SDL_VIDEO_OPENGL_EGL
     if (window->flags & SDL_WINDOW_OPENGL) {
+
         if(wind->output_rotation == 90 || wind->output_rotation == 270)
             wind->egl_window = wl_egl_window_create(wind->surface, window->h, window->w);
         else
@@ -526,6 +529,11 @@ Tizen_CreateWindow(_THIS, SDL_Window *window)
                 wind->support_pre_rotation = 1;
             }
         }
+        else
+        {
+            wl_egl_window_resize(wind->egl_window, window->w, window->h, 0, 0);
+        }
+
     }
 #endif