efl_ui/layout: move 'frozen' struct member to be a bool bitflag
authorMike Blumenkrantz <zmike@samsung.com>
Mon, 23 Sep 2019 13:30:03 +0000 (09:30 -0400)
committerJongmin Lee <jm105.lee@samsung.com>
Mon, 23 Sep 2019 21:32:19 +0000 (06:32 +0900)
this is already handled by edje, all we really want here is a flag
to avoid more eo lookups internally when calling canvas_group_change

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10079

src/lib/elementary/efl_ui_layout.c
src/lib/elementary/elm_widget_layout.h

index 261a47c..e586ce6 100644 (file)
@@ -2023,26 +2023,25 @@ EOLIAN static int
 _efl_ui_layout_base_efl_layout_calc_calc_freeze(Eo *obj, Efl_Ui_Layout_Data *sd)
 {
    ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, 0);
-
-   if ((sd->frozen)++ != 0) return sd->frozen;
-
-   edje_object_freeze(wd->resize_obj);
-
-   return 1;
+   sd->frozen = EINA_TRUE;
+   return edje_object_freeze(wd->resize_obj);
 }
 
 EOLIAN static int
 _efl_ui_layout_base_efl_layout_calc_calc_thaw(Eo *obj, Efl_Ui_Layout_Data *sd)
 {
+   int ret;
    ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, 0);
 
-   if (--(sd->frozen) != 0) return sd->frozen;
-
-   edje_object_thaw(wd->resize_obj);
+   ret = edje_object_thaw(wd->resize_obj);
 
-   efl_canvas_group_change(obj);
+   if (!ret)
+     {
+        sd->frozen = EINA_FALSE;
+        efl_canvas_group_change(obj);
+     }
 
-   return 0;
+   return ret;
 }
 
 EOLIAN void
index 2e74d99..593f770 100644 (file)
@@ -63,10 +63,9 @@ typedef struct _Efl_Ui_Layout_Data
       Eina_Bool          updating : 1;
    } connect;
 
-   int                   frozen; /**< Layout freeze counter */
-
    unsigned int          finger_size_multiplier_x, finger_size_multiplier_y; /**< multipliers for finger_size during group_calc */
 
+   Eina_Bool             frozen; /**< Layout freeze state */
    Eina_Bool             can_access : 1; /**< This is true when all text(including textblock) parts can be accessible by accessibility. */
    Eina_Bool             destructed_is : 1; /**< This flag indicates if Efl.Ui.Layout destructor was called. This is needed to avoid unnecessary calculation of subobject deletion during layout object's deletion. */
    Eina_Bool             file_set : 1; /**< This flag indicates if Efl.Ui.Layout source is set from a file*/