[SDL_Tizen] Do set_buffer_transform 87/139687/3
authorhuiyu.eun <huiyu.eun@samsung.com>
Thu, 20 Jul 2017 06:20:10 +0000 (15:20 +0900)
committerhuiyu.eun <huiyu.eun@samsung.com>
Fri, 21 Jul 2017 05:39:27 +0000 (14:39 +0900)
Do set_buffer_transform

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

index ede9158..b4000c4 100755 (executable)
@@ -513,6 +513,12 @@ _tizen_send_rotation_event(SDL_Window *window, unsigned int angle)
     return;
 }
 
+int
+_tizen_get_rotation_idx(int rotation)
+{
+    return ((rotation % 360) / 90);
+}
+
 void
 _tizen_rotation_do(SDL_Window *window, SDL_WindowData* wind, int rotation)
 {
@@ -525,9 +531,20 @@ _tizen_rotation_do(SDL_Window *window, SDL_WindowData* wind, int rotation)
     _tizen_set_window_size(window, window_w, window_h);
 
     if(wind->support_pre_rotation)
+    {
         Tizen_pre_rotation_set(wind, rotation);
+        wl_egl_window_set_buffer_transform(wind->egl_window, _tizen_get_rotation_idx(rotation));
+        wl_egl_window_set_window_transform(wind->egl_window, _tizen_get_rotation_idx(wind->rotation));
+    }
+    else
+    {
+        wl_egl_window_resize(wind->egl_window, window_w, window_h, 0, 0);
+        wl_egl_window_set_buffer_transform(wind->egl_window, _tizen_get_rotation_idx((360 - wind->rotation)));
+        wl_egl_window_set_window_transform(wind->egl_window, _tizen_get_rotation_idx(0));
+    }
 
-    _tizen_send_rotation_event(window, wind->rotation);
+
+    _tizen_send_rotation_event(window, 0);
     SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SIZE_CHANGED, window->w, window->h);
 
 }
@@ -551,8 +568,6 @@ Tizen_rotate_update(SDL_Window *window)
 
     //Set Screen Rotation
     wind->output_rotation = screen_rotation;
-    if(wind->support_pre_rotation)
-        ecore_wl_window_buffer_transform_set(wind->window, wind->output_rotation / 90);
 
     ecore_wl_window_rotation_set(wind->window, wind->rotation);