From: huiyu.eun Date: Thu, 20 Jul 2017 06:20:10 +0000 (+0900) Subject: [SDL_Tizen] Do set_buffer_transform X-Git-Tag: accepted/tizen/4.0/unified/20170816.012908~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F87%2F139687%2F3;p=platform%2Fupstream%2FSDL.git [SDL_Tizen] Do set_buffer_transform Do set_buffer_transform Change-Id: I1c0003be100b31be438d16f2adabfe5fc0ca9b06 Signed-off-by: huiyu.eun --- diff --git a/src/video/tizen/SDL_tizenwindow.c b/src/video/tizen/SDL_tizenwindow.c index ede9158..b4000c4 100755 --- a/src/video/tizen/SDL_tizenwindow.c +++ b/src/video/tizen/SDL_tizenwindow.c @@ -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);