e_hwc_window: fix the below_transparent_obj geometry when ec is transformed 20/303920/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Fri, 5 Jan 2024 02:58:08 +0000 (11:58 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 8 Jan 2024 06:06:10 +0000 (15:06 +0900)
fix mismatch geometry of ec and the below_transparent_obj

Change-Id: Ifb53f1c1e7f71e0e5a272587a97e6bbe3ec9e115

src/bin/e_hwc_window.c

index 6f67f38..11286e1 100644 (file)
@@ -3208,26 +3208,53 @@ e_hwc_window_presentation_callback_call(E_Hwc_Window *hwc_window)
 static void
 _e_hwc_window_below_transparent_obj_map_apply(E_Hwc_Window *hwc_window)
 {
-   E_Map *map;
+   E_Map *map = NULL, *new_map = NULL;
    int w, h;
+   Eina_Bool enable;
 
    EINA_SAFETY_ON_NULL_RETURN(hwc_window->below_transparent_obj);
 
-   map = e_map_new();
-   EINA_SAFETY_ON_NULL_RETURN(map);
-
-   e_map_util_points_populate_from_object_full(map, hwc_window->ec->frame, 0);
-   e_map_util_points_color_set(map, 255, 255, 255, 255);
    evas_object_geometry_get(hwc_window->below_transparent_obj, NULL, NULL, &w, &h);
-   e_map_point_image_uv_set(map, 0, 0, 0);
-   e_map_point_image_uv_set(map, 1, w, 0);
-   e_map_point_image_uv_set(map, 2, w, h);
-   e_map_point_image_uv_set(map, 3, 0, h);
 
-   e_comp_object_map_set(hwc_window->below_transparent_obj, map);
+   enable = e_client_transform_core_enable_get(hwc_window->ec);
+   if (enable)
+     map = e_comp_object_map_get(hwc_window->ec->frame);
+
+   if ((enable) && (map))
+     {
+        new_map = e_map_dup(map);
+        if (!new_map)
+          {
+             EHWERR("fail to dup e_map", hwc_window->ec, hwc_window->hwc, hwc_window);
+             e_map_free(map);
+             return;
+          }
+     }
+   else
+     {
+        new_map = e_map_new();
+        if (!new_map)
+          {
+             EHWERR("fail to new e_map", hwc_window->ec, hwc_window->hwc, hwc_window);
+             if (map) e_map_free(map);
+             return;
+          }
+
+        e_map_util_points_populate_from_object_full(new_map, hwc_window->ec->frame, 0);
+        e_map_util_points_color_set(new_map, 255, 255, 255, 255);
+     }
+
+   e_map_point_image_uv_set(new_map, 0, 0, 0);
+   e_map_point_image_uv_set(new_map, 1, w, 0);
+   e_map_point_image_uv_set(new_map, 2, w, h);
+   e_map_point_image_uv_set(new_map, 3, 0, h);
+
+   e_comp_object_map_set(hwc_window->below_transparent_obj, new_map);
    e_comp_object_map_enable_set(hwc_window->below_transparent_obj, EINA_TRUE);
 
-   e_map_free(map);
+   if (map) e_map_free(map);
+
+   e_map_free(new_map);
 }
 
 static void