cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=74cfe457c32669f0ac2b96bf18b093488acb7595

commit 74cfe457c32669f0ac2b96bf18b093488acb7595
Author: Mike Blumenkrantz <zm...@samsung.com>
Date:   Mon Sep 23 09:30:03 2019 -0400

    efl_ui/layout: move 'frozen' struct member to be a bool bitflag
    
    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.b...@free.fr>
    Differential Revision: https://phab.enlightenment.org/D10079
---
 src/lib/elementary/efl_ui_layout.c     | 21 ++++++++++-----------
 src/lib/elementary/elm_widget_layout.h |  3 +--
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/src/lib/elementary/efl_ui_layout.c 
b/src/lib/elementary/efl_ui_layout.c
index 98f731fdea..bcc947ba22 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -1834,26 +1834,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
diff --git a/src/lib/elementary/elm_widget_layout.h 
b/src/lib/elementary/elm_widget_layout.h
index 62949cae15..0997ccbb0d 100644
--- a/src/lib/elementary/elm_widget_layout.h
+++ b/src/lib/elementary/elm_widget_layout.h
@@ -62,10 +62,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*/

-- 


Reply via email to