From: huiyu,eun Date: Wed, 27 Dec 2017 09:09:15 +0000 (+0900) Subject: [SDL_Tizen] Fix drawing issue X-Git-Tag: accepted/tizen/unified/20180328.010144~2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2FSDL.git;a=commitdiff_plain;h=0822cdcfd4f09b5876a8fd52fe40d11b46e7a66d [SDL_Tizen] Fix drawing issue Change-Id: I04b684e8b47d491266545021ebf6d5ffcb686a10 Signed-off-by: huiyu,eun --- diff --git a/src/video/tizen/SDL_tizenopengles.c b/src/video/tizen/SDL_tizenopengles.c index 31e13e8..dd19536 100755 --- a/src/video/tizen/SDL_tizenopengles.c +++ b/src/video/tizen/SDL_tizenopengles.c @@ -65,10 +65,13 @@ Tizen_GLES_SwapWindow(_THIS, SDL_Window *window) { SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface); SDL_WindowData* wind = (SDL_WindowData*)window->driverdata; - if (wind->received_rotation == 1) { + if (wind->received_rotation != TIZEN_ROTATION_RECEIVED_NONE) { Tizen_rotate_update(window); - ecore_wl_window_rotation_change_done_send(wind->window); - wind->received_rotation = 0; + + if(wind->received_rotation == TIZEN_ROTATION_RECEIVED_WINDOW_ROATION) + ecore_wl_window_rotation_change_done_send(wind->window); + + wind->received_rotation = TIZEN_ROTATION_RECEIVED_NONE; SDL_VideoData* videoData = SDL_GetVideoDevice()->driverdata; if(videoData->indicator_on && wind->support_indicator) diff --git a/src/video/tizen/SDL_tizenwindow.c b/src/video/tizen/SDL_tizenwindow.c index 9d1e95d..29f809b 100755 --- a/src/video/tizen/SDL_tizenwindow.c +++ b/src/video/tizen/SDL_tizenwindow.c @@ -619,7 +619,7 @@ _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; - wind->received_rotation = 1; + wind->received_rotation = TIZEN_ROTATION_RECEIVED_SCREEN_ROTATION; return ECORE_CALLBACK_PASS_ON; @@ -633,7 +633,7 @@ _tizen_cb_ignore_output_transform(void *data, int type EINA_UNUSED, void *event if(!wind) return ECORE_CALLBACK_PASS_ON; - wind->received_rotation = 1; + wind->received_rotation = TIZEN_ROTATION_RECEIVED_SCREEN_ROTATION; return ECORE_CALLBACK_PASS_ON; } @@ -736,7 +736,7 @@ Tizen_CreateWindow(_THIS, SDL_Window *window) wind->rotation = 0; wind->rotation_supported = 0; - wind->received_rotation = 0; + wind->received_rotation = TIZEN_ROTATION_RECEIVED_NONE; #if SDL_VIDEO_OPENGL_EGL if (window->flags & SDL_WINDOW_OPENGL) { @@ -945,11 +945,9 @@ _tizen_cb_event_window_rotate(void *data, int type EINA_UNUSED, void *event) window = Tizen_FindWindow(_this, ew); wind = window->driverdata; - if (wind->rotation != ev->angle) { - /* set ecore_wayland window rotation */ - wind->rotation = ev->angle; - wind->received_rotation = 1; - } + /* set ecore_wayland window rotation */ + wind->rotation = ev->angle; + wind->received_rotation = TIZEN_ROTATION_RECEIVED_WINDOW_ROATION; return ECORE_CALLBACK_PASS_ON; } diff --git a/src/video/tizen/SDL_tizenwindow.h b/src/video/tizen/SDL_tizenwindow.h index 1b5fff1..c2129b3 100755 --- a/src/video/tizen/SDL_tizenwindow.h +++ b/src/video/tizen/SDL_tizenwindow.h @@ -65,6 +65,12 @@ typedef enum { TIZEN_ROTATION_270 = 270 } tizen_wl_egl_window_rotation; +typedef enum { + TIZEN_ROTATION_RECEIVED_NONE = 0, + TIZEN_ROTATION_RECEIVED_SCREEN_ROTATION = 1, + TIZEN_ROTATION_RECEIVED_WINDOW_ROATION = 2 +}; + extern SDL_Window* Tizen_FindWindow(_THIS, Ecore_Wl_Window *ewin); extern void Tizen_SetWindowTitle(_THIS, SDL_Window * window); extern void Tizen_ShowWindow(_THIS, SDL_Window *window);