From f069db6f412a09416ddbe713d12b2ea6686fe52b Mon Sep 17 00:00:00 2001 From: SangHyeon Jade Lee Date: Mon, 4 Jan 2021 17:10:11 +0900 Subject: [PATCH] gengrid: modify getenv calls as getenv is expensive calls Change-Id: I9f7dbd9eeff97d74c645108933fe3e33423cba0e --- src/lib/elementary/elm_gengrid.c | 6 +++++- src/lib/elementary/elm_widget_gengrid.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c index dfe3f1a..f211f9e 100755 --- a/src/lib/elementary/elm_gengrid.c +++ b/src/lib/elementary/elm_gengrid.c @@ -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 diff --git a/src/lib/elementary/elm_widget_gengrid.h b/src/lib/elementary/elm_widget_gengrid.h index 92ed4a0..23489b6 100755 --- a/src/lib/elementary/elm_widget_gengrid.h +++ b/src/lib/elementary/elm_widget_gengrid.h @@ -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 -- 2.7.4