From: huiyu.eun Date: Wed, 28 Jun 2017 08:03:47 +0000 (+0900) Subject: [SDL_Tizen] Change rotation function position X-Git-Tag: accepted/tizen/unified/20170710.154330~7^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F45%2F136145%2F1;p=platform%2Fupstream%2FSDL.git [SDL_Tizen] Change rotation function position Call _tizen_rotate_update after swap buffer Change-Id: Ie01f06ca4321a51a1e6b6ec73a07ab7da1c2b256 Signed-off-by: huiyu.eun --- diff --git a/src/video/tizen/SDL_tizenopengles.c b/src/video/tizen/SDL_tizenopengles.c index e60be60..e2fddc3 100755 --- a/src/video/tizen/SDL_tizenopengles.c +++ b/src/video/tizen/SDL_tizenopengles.c @@ -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 diff --git a/src/video/tizen/SDL_tizenwindow.c b/src/video/tizen/SDL_tizenwindow.c index cf79c38..8821f79 100755 --- a/src/video/tizen/SDL_tizenwindow.c +++ b/src/video/tizen/SDL_tizenwindow.c @@ -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;