[SDL_Tizen] Change rotation function position 45/136145/1
authorhuiyu.eun <huiyu.eun@samsung.com>
Wed, 28 Jun 2017 08:03:47 +0000 (17:03 +0900)
committerhuiyu.eun <huiyu.eun@samsung.com>
Wed, 28 Jun 2017 08:27:23 +0000 (17:27 +0900)
Call _tizen_rotate_update after swap buffer

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

index e60be60..e2fddc3 100755 (executable)
@@ -63,14 +63,13 @@ Tizen_GLES_CreateContext(_THIS, SDL_Window *window)
 void
 Tizen_GLES_SwapWindow(_THIS, SDL_Window *window)
 {
+    SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
     SDL_WindowData* wdata = (SDL_WindowData*)window->driverdata;
-
     if (wdata->received_rotation == 1) {
+        _tizen_rotate_update(wdata);
         ecore_wl_window_rotation_change_done_send(wdata->window);
         wdata->received_rotation = 0;
     }
-
-    SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
 }
 
 int
index cf79c38..8821f79 100755 (executable)
@@ -379,7 +379,8 @@ _tizen_cb_output_transform(void *data, int type EINA_UNUSED, void *event)
     output = ecore_wl_window_output_find(wind->window);
     if (output != ev->output) return ECORE_CALLBACK_PASS_ON;
 
-    _tizen_rotate_update(wind);
+    wind->received_rotation = 1;
+
 
    return ECORE_CALLBACK_PASS_ON;
 }
@@ -392,7 +393,7 @@ _tizen_cb_ignore_output_transform(void *data, int type EINA_UNUSED, void *event
 
     if(!wind) return ECORE_CALLBACK_PASS_ON;
 
-    _tizen_rotate_update(wind);
+    wind->received_rotation = 1;
 
    return ECORE_CALLBACK_PASS_ON;
 }
@@ -506,7 +507,6 @@ _tizen_rotation_do(SDL_WindowData *wind, int rotation)
 
     _tizen_send_rotation_event(window, wind->rotation);
     SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SIZE_CHANGED, window->w, window->h);
-    wind->received_rotation = 1;
 
 }
 
@@ -528,10 +528,11 @@ _tizen_rotate_update(SDL_WindowData *wind)
 
     //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);
+
     int rotation = (wind->output_rotation + wind->rotation) % 360;
     _tizen_rotation_do(wind, rotation);
 }
@@ -843,8 +844,7 @@ _tizen_cb_event_window_rotate(void *data, int type EINA_UNUSED, void *event)
     if (wind->rotation != ev->angle) {
         /* set ecore_wayland window rotation */
         wind->rotation = ev->angle;
-        ecore_wl_window_rotation_set(wind->window, wind->rotation);
-        _tizen_rotate_update(wind);
+        wind->received_rotation = 1;
     }
 
     return ECORE_CALLBACK_PASS_ON;