From: huiyu.eun Date: Tue, 4 Jul 2017 03:02:07 +0000 (+0900) Subject: [SDL_Tizen] Fix rotation issue X-Git-Tag: accepted/tizen/unified/20170710.154330~3^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F96%2F136996%2F1;p=platform%2Fupstream%2FSDL.git [SDL_Tizen] Fix rotation issue - If occurs rotatation event, rotate all SDL_Window Change-Id: I3b584733406bbca603d95e67b02ac3dc2f1bc223 Signed-off-by: huiyu.eun --- diff --git a/src/video/tizen/SDL_tizenopengles.c b/src/video/tizen/SDL_tizenopengles.c index f2a91c8..5452cad 100755 --- a/src/video/tizen/SDL_tizenopengles.c +++ b/src/video/tizen/SDL_tizenopengles.c @@ -66,7 +66,7 @@ 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); + Tizen_rotate_update(window); ecore_wl_window_rotation_change_done_send(wdata->window); wdata->received_rotation = 0; } diff --git a/src/video/tizen/SDL_tizenwindow.c b/src/video/tizen/SDL_tizenwindow.c index 6764bcd..9d0b26d 100755 --- a/src/video/tizen/SDL_tizenwindow.c +++ b/src/video/tizen/SDL_tizenwindow.c @@ -388,13 +388,8 @@ _tizen_send_rotation_event(SDL_Window *window, unsigned int angle) } void -_tizen_rotation_do(SDL_WindowData *wind, int rotation) +_tizen_rotation_do(SDL_Window *window, SDL_WindowData* wind, int rotation) { - if(!wind) return; - - SDL_Window *window = SDL_GetVideoDevice()->windows; - if(!window) return; - int window_w, window_h; if(wind->rotation == 0 || wind->rotation == 180) ecore_wl_window_geometry_get(wind->window, 0, 0, &window_w, &window_h); @@ -412,8 +407,9 @@ _tizen_rotation_do(SDL_WindowData *wind, int rotation) } void -Tizen_rotate_update(SDL_WindowData *wind) +Tizen_rotate_update(SDL_Window *window) { + SDL_WindowData *wind = window->driverdata; if(!wind) return; int screen_rotation; @@ -435,7 +431,7 @@ Tizen_rotate_update(SDL_WindowData *wind) ecore_wl_window_rotation_set(wind->window, wind->rotation); int rotation = (wind->output_rotation + wind->rotation) % 360; - _tizen_rotation_do(wind, rotation); + _tizen_rotation_do(window, wind, rotation); } void @@ -492,7 +488,8 @@ _tizen_window_orientaiton_hint_callback(void *userdata, const char *name, const ecore_wl_window_rotation_available_rotations_set(window, (const int*)checked, j); } } - Tizen_rotate_update(wind); + + Tizen_rotate_update(Tizen_FindWindow(SDL_GetVideoDevice(), window)); } void @@ -676,7 +673,7 @@ Tizen_CreateWindow(_THIS, SDL_Window *window) // Add orientaiton hint cb _tizen_window_orientation_add_hint((void*)wind); - Tizen_rotate_update(wind); + Tizen_rotate_update(window); return 0; } diff --git a/src/video/tizen/SDL_tizenwindow.h b/src/video/tizen/SDL_tizenwindow.h index 680536b..844bccc 100755 --- a/src/video/tizen/SDL_tizenwindow.h +++ b/src/video/tizen/SDL_tizenwindow.h @@ -95,7 +95,7 @@ extern int Tizen_InitWindow(_THIS); extern void Tizen_DeinitWindow(_THIS); extern void Tizen_pre_rotation_set(SDL_WindowData *_this, int rotation); -extern void Tizen_rotate_update(SDL_WindowData *wind); +extern void Tizen_rotate_update(SDL_Window *window); extern int _tizen_init_ecore_ipc(); extern void _tizen_ecore_ipc_client_send(int major, int minor, int ref, int ref_to);