From eca466dbd89754e2c0b5853e78e0b0d9ff904305 Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Fri, 5 Jun 2020 16:07:14 +0900 Subject: [PATCH] e_hwc_window: fix wrong dst_pos when screen rotation is enabled If buffer of client is transformed due to screen rotation 90 or 270, width and height of dst_pos should be swapped Change-Id: Ice98bfc82226c2c803c4025785f0d735bfbfb7ae --- src/bin/e_hwc_window.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/bin/e_hwc_window.c b/src/bin/e_hwc_window.c index 334a1e7859..d05c910e22 100644 --- a/src/bin/e_hwc_window.c +++ b/src/bin/e_hwc_window.c @@ -1041,6 +1041,7 @@ _e_hwc_window_info_get(E_Hwc_Window *hwc_window, tdm_hwc_window_info *hwc_win_in E_Client *ec = NULL; tbm_surface_h tsurface = NULL; tbm_surface_info_s surf_info = {0}; + int transform; int x, y, w, h; ec = hwc_window->ec; @@ -1090,10 +1091,22 @@ _e_hwc_window_info_get(E_Hwc_Window *hwc_window, tdm_hwc_window_info *hwc_win_in hwc_win_info->dst_pos.y = dst_y; } - hwc_win_info->dst_pos.w = w; - hwc_win_info->dst_pos.h = h; + transform = e_comp_wl_output_buffer_transform_get(ec); + switch (transform) + { + case WL_OUTPUT_TRANSFORM_90: + case WL_OUTPUT_TRANSFORM_FLIPPED_90: + case WL_OUTPUT_TRANSFORM_270: + case WL_OUTPUT_TRANSFORM_FLIPPED_270: + hwc_win_info->dst_pos.w = h; + hwc_win_info->dst_pos.h = w; + break; + default: + hwc_win_info->dst_pos.w = w; + hwc_win_info->dst_pos.w = h; + break; + } - // TODO: need to calculation with ec(window) rotation and output->config.rotation? hwc_win_info->transform = TDM_TRANSFORM_NORMAL; return EINA_TRUE; -- 2.34.1