gengrid: modify getenv calls as getenv is expensive calls 47/250747/2
authorSangHyeon Jade Lee <sh10233.lee@samsung.com>
Mon, 4 Jan 2021 08:10:11 +0000 (17:10 +0900)
committerSangHyeon Jade Lee <sh10233.lee@samsung.com>
Mon, 4 Jan 2021 08:11:39 +0000 (17:11 +0900)
Change-Id: I9f7dbd9eeff97d74c645108933fe3e33423cba0e

src/lib/elementary/elm_gengrid.c
src/lib/elementary/elm_widget_gengrid.h

index dfe3f1a..f211f9e 100755 (executable)
@@ -2094,7 +2094,7 @@ _item_place(Elm_Gen_Item *it,
    it->x = cx;
    it->y = cy;
    evas_object_geometry_get(wsd->pan_obj, &ox, &oy, &vw, &vh);
-   if (getenv("GENGRID_REALIZE_POLICY_WITH_CANVAS_OUTPUT_SIZE"))
+   if (wsd->canvas_output_mode)
      {
         evas_output_viewport_get
            (evas_object_evas_get(wsd->pan_obj), &cvx, &cvy, &cvw, &cvh);
@@ -5493,6 +5493,10 @@ _elm_gengrid_efl_canvas_group_group_add(Eo *obj, Elm_Gengrid_Data *priv)
    priv->custom_size_sum = NULL;
    priv->custom_tot_sum = NULL;
    priv->custom_alloc_size = 0;
+
+   if (getenv("GENGRID_REALIZE_POLICY_WITH_CANVAS_OUTPUT_SIZE"))
+     priv->canvas_output_mode = EINA_TRUE;
+   else priv->canvas_output_mode = EINA_FALSE;
 }
 
 EOLIAN static void
index 92ed4a0..23489b6 100755 (executable)
@@ -182,6 +182,7 @@ struct _Elm_Gengrid_Data
    Eina_Bool                          scr_minw;
    Eina_Bool                          scr_minh;
    Eina_Bool                          order_dirty; /* boolean flag indicating if there needs to be an update to the focus_order of the widget.*/
+   Eina_Bool                          canvas_output_mode; /* boolean flag for chaging realization target to canvas output. */
 };
 
 struct Elm_Gen_Item_Type