desk zoom: modify code to zoom the e_desk with transform 64/211364/6
authorDoyoun Kang <doyoun.kang@samsung.com>
Fri, 2 Aug 2019 02:29:47 +0000 (11:29 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Wed, 7 Aug 2019 09:31:56 +0000 (09:31 +0000)
Change-Id: Iea879df066ead94007e32f4e0aaf468de7c97522

src/bin/e_client.c
src/bin/e_client.h
src/bin/e_comp_object.c
src/bin/e_comp_object.h
src/bin/e_desk.c

index c1c6a87b750f057d0edfa861aa76e7ba08085bcf..2e2636d7b1117407e689d0951f097945cfb9344c 100644 (file)
@@ -3737,6 +3737,34 @@ _e_client_transform_core_map_new(Evas_Object *obj,
    return map;
 }
 
+static void
+_e_client_transform_core_vertices_apply_with_zoom(E_Client *ec EINA_UNUSED,
+                                        Evas_Object *obj,
+                                        E_Util_Transform_Rect_Vertex *vertices,
+                                        E_Util_Transform *transform,
+                                        double zoomx, double zoomy,
+                                        Evas_Coord cx, Evas_Coord cy)
+{
+   Evas_Map *map = NULL;
+
+   if (!obj) return;
+
+   if (vertices)
+     {
+        map = _e_client_transform_core_map_new(obj, vertices, transform);
+        EINA_SAFETY_ON_NULL_RETURN(map);
+
+        evas_map_util_zoom(map, zoomx, zoomy, cx, cy);
+
+        evas_object_map_set(obj, map);
+        evas_object_map_enable_set(obj, EINA_TRUE);
+
+        evas_map_free(map);
+     }
+   else
+     evas_object_map_enable_set(obj, EINA_FALSE);
+}
+
 static void
 _e_client_transform_core_vertices_apply(E_Client *ec EINA_UNUSED,
                                         Evas_Object *obj,
@@ -3783,6 +3811,20 @@ _e_client_transform_core_sub_update(E_Client *ec, E_Util_Transform_Rect_Vertex *
       e_client_transform_core_update(subc);
 }
 
+static void
+_e_client_transform_core_sub_update_with_zoom(E_Client *ec, E_Util_Transform_Rect_Vertex *vertices, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy)
+{
+   E_Comp_Wl_Client_Data *cdata;
+
+   if (!ec) return;
+   if (!ec->comp_data) return;
+
+   cdata = (E_Comp_Wl_Client_Data*)ec->comp_data;
+
+   if (cdata->sub.below_obj)
+     _e_client_transform_core_vertices_apply_with_zoom(ec, cdata->sub.below_obj, vertices, NULL, zoomx, zoomy, cx, cy);
+}
+
 static void
 _e_client_cb_hook_shell_surface_ready(void *data EINA_UNUSED, E_Client *ec)
 {
@@ -7087,6 +7129,44 @@ e_client_transform_core_input_inv_rect_transform(E_Client *ec, int x, int y, int
                                                x, y, out_x, out_y);
 }
 
+static void
+_e_client_transform_core_update_with_zoom(E_Client *ec, double zoomx, double zoomy, int cx, int cy)
+{
+   if (!ec) return;
+
+   e_comp_object_transform_transp_vertices_set_with_zoom(ec->frame, &ec->transform_core.result.vertices,
+                                                         zoomx, zoomy, cx, cy);
+   e_comp_object_transform_bg_vertices_set_with_zoom(ec->frame, &ec->transform_core.result.boundary.vertices,
+                                                     zoomx, zoomy, cx, cy);
+   _e_client_transform_core_vertices_apply_with_zoom(ec, ec->frame, &ec->transform_core.result.vertices, &ec->transform_core.result.transform,
+                                                     zoomx, zoomy, cx, cy);
+   _e_client_transform_core_sub_update_with_zoom(ec, &ec->transform_core.result.vertices,
+                                                 zoomx, zoomy, cx, cy);
+}
+
+EINTERN void
+e_client_transform_core_update_with_desk_zoom(E_Client *ec)
+{
+   E_Desk *desk;
+   double zoomx, zoomy;
+   Evas_Coord cx, cy;
+   Eina_Bool ret;
+   Eina_Bool enable;
+
+   if (!ec) return;
+   if (ec->new_client) return;
+
+   desk = ec->desk;
+   if (!desk) return;
+
+   ret = e_desk_zoom_get(desk, &zoomx, &zoomy, &cx, &cy);
+   if (!ret) return;
+
+   enable = e_client_transform_core_enable_get(ec);
+   if (enable)
+     _e_client_transform_core_update_with_zoom(ec, zoomx, zoomy, cx, cy);
+}
+
 E_API E_Pixmap *
 e_client_pixmap_change(E_Client *ec, E_Pixmap *newcp)
 {
index 27e88a1b27a5e9c9cfa55d6a2ae3ad299cb8ff19..a17b5548f2662831fa115fe16f8e35075f3e36d9 100644 (file)
@@ -1150,6 +1150,7 @@ E_API E_Util_Transform *e_client_transform_core_transform_get(E_Client *ec, int
 E_API void              e_client_transform_core_input_transform(E_Client *ec, int x, int y, int *out_x, int *out_y);
 E_API void              e_client_transform_core_input_inv_transform(E_Client *ec, int x, int y, int *out_x, int *out_y);
 E_API void              e_client_transform_core_input_inv_rect_transform(E_Client *ec, int x, int y, int *out_x, int *out_y);
+EINTERN void            e_client_transform_core_update_with_desk_zoom(E_Client *ec);
 
 E_API E_Pixmap *e_client_pixmap_change(E_Client *ec, E_Pixmap *newcp);
 E_API void e_client_window_role_set(E_Client *ec, const char *role);
index 6c1465edb459b5e30c0653e4f2c980de5a3a921b..7dcc8c6f22ae43a5c53b85fce5fe32f6e37efd24 100644 (file)
@@ -507,6 +507,29 @@ _e_comp_object_transform_obj_map_set(Evas_Object *obj, E_Util_Transform_Rect_Ver
      }
 }
 
+static void
+_e_comp_object_transform_obj_map_set_with_zoom(Evas_Object *obj, E_Util_Transform_Rect_Vertex *vertices, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy)
+{
+   if (!obj) return;
+
+   if (vertices)
+     {
+        Evas_Map *map = _e_comp_object_transform_obj_map_new(obj, vertices);
+        if (map)
+          {
+             evas_map_util_zoom(map, zoomx, zoomy, cx, cy);
+
+             evas_object_map_set(obj, map);
+             evas_object_map_enable_set(obj, EINA_TRUE);
+
+             evas_map_free(map);
+          }
+     }
+   else
+     {
+        evas_object_map_enable_set(obj, EINA_FALSE);
+     }
+}
 /////////////////////////////////////
 
 static inline Eina_Bool
@@ -5268,6 +5291,17 @@ e_comp_object_transform_bg_vertices_set(Evas_Object *obj, E_Util_Transform_Rect_
    _e_comp_object_transform_obj_map_set(cw->transform_bg_obj, vertices);
 }
 
+EINTERN void
+e_comp_object_transform_bg_vertices_set_with_zoom(Evas_Object *obj, E_Util_Transform_Rect_Vertex *vertices, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy)
+{
+   API_ENTRY;
+   EINA_SAFETY_ON_NULL_RETURN(cw->ec);
+   if (cw->ec->input_only) return;
+   if (!cw->transform_bg_obj) return;
+
+   _e_comp_object_transform_obj_map_set_with_zoom(cw->transform_bg_obj, vertices, zoomx, zoomy, cx, cy);
+}
+
 E_API void
 e_comp_object_transform_transp_set(Evas_Object *obj, Eina_Bool set)
 {
@@ -5314,6 +5348,17 @@ e_comp_object_transform_transp_vertices_set(Evas_Object *obj, E_Util_Transform_R
    _e_comp_object_transform_obj_map_set(cw->transform_tranp_obj, vertices);
 }
 
+EINTERN void
+e_comp_object_transform_transp_vertices_set_with_zoom(Evas_Object *obj, E_Util_Transform_Rect_Vertex *vertices, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy)
+{
+   API_ENTRY;
+   EINA_SAFETY_ON_NULL_RETURN(cw->ec);
+   if (cw->ec->input_only) return;
+   if (!cw->transform_tranp_obj) return;
+
+   _e_comp_object_transform_obj_map_set_with_zoom(cw->transform_tranp_obj, vertices, zoomx, zoomy, cx, cy);
+}
+
 E_API void
 e_comp_object_layer_update(Evas_Object *obj,
                            Evas_Object *above, Evas_Object *below)
index 62ac1a9ed278aa00ecdcfc85b3696f7adf13c083..102e8fad29938392efea1098332b8a2bbcf13cf3 100644 (file)
@@ -157,8 +157,10 @@ E_API Eina_Bool e_comp_object_mask_has(Evas_Object *obj);
 E_API void e_comp_object_size_update(Evas_Object *obj, int w, int h);
 E_API void e_comp_object_transform_bg_set(Evas_Object *obj, Eina_Bool set);
 E_API void e_comp_object_transform_bg_vertices_set(Evas_Object *obj, E_Util_Transform_Rect_Vertex *vertices);
+EINTERN void e_comp_object_transform_bg_vertices_set_with_zoom(Evas_Object *obj, E_Util_Transform_Rect_Vertex *vertices, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy);
 E_API void e_comp_object_transform_transp_set(Evas_Object *obj, Eina_Bool set);
 E_API void e_comp_object_transform_transp_vertices_set(Evas_Object *obj, E_Util_Transform_Rect_Vertex *vertices);
+EINTERN void e_comp_object_transform_transp_vertices_set_with_zoom(Evas_Object *obj, E_Util_Transform_Rect_Vertex *vertices, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy);
 
 E_API void e_comp_object_layer_update(Evas_Object *obj, Evas_Object *above, Evas_Object *below);
 
index fbb835b7e2abdfee7afaa42954d08dc0832c04bf..dfa42fc75249053f6280cfcd5bca407c4a05d14b 100644 (file)
@@ -1048,7 +1048,7 @@ e_desk_zoom_unset(E_Desk *desk)
               * Why isn't it enough to just call evas_object_map_enable_set(false)? */
              _e_desk_client_zoom(ec, sd->zoom.ratio_x, sd->zoom.ratio_y,
                                  sd->zoom.cord_x, sd->zoom.cord_y);
-             evas_object_map_enable_set(ec->frame, EINA_FALSE);
+             //evas_object_map_enable_set(ec->frame, EINA_FALSE);
           }
 
         /* FIXME TEMP enable hwc */
@@ -1470,5 +1470,19 @@ _e_desk_object_zoom(Evas_Object *obj, double zoomx, double zoomy, Evas_Coord cx,
 static void
 _e_desk_client_zoom(E_Client *ec, double zoomx, double zoomy, Evas_Coord cx, Evas_Coord cy)
 {
-   _e_desk_object_zoom(ec->frame, zoomx, zoomy, cx, cy);
+   Eina_Bool transformed;
+   transformed = e_client_transform_core_enable_get(ec);
+
+   if (transformed)
+     e_client_transform_core_update_with_desk_zoom(ec);
+   else
+     _e_desk_object_zoom(ec->frame, zoomx, zoomy, cx, cy);
+
+   if (evas_object_visible_get(ec->frame))
+     {
+        // force update
+        e_comp_object_damage(ec->frame, 0, 0, ec->w, ec->h);
+        e_comp_object_dirty(ec->frame);
+        e_comp_object_render(ec->frame);
+     }
 }