elm_interface_scrollable: freeze the manager object when content moves
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Thu, 22 Nov 2018 14:47:52 +0000 (15:47 +0100)
committerHermet Park <hermetpark@gmail.com>
Wed, 5 Dec 2018 05:43:46 +0000 (14:43 +0900)
this freezes the manager object of the user of the interface. This
improves the overall performance when moving arround focus in a
scrollable object, since no new relations are needed to be recalculated.
This safes up about 2% in the "Scroller 2" test. Additional
optimizations are added in another commit.

Differential Revision: https://phab.enlightenment.org/D7349

src/lib/elementary/elm_interface_scrollable.c
src/lib/elementary/elm_interface_scrollable.h

index 160d54e..b614006 100644 (file)
@@ -105,7 +105,15 @@ static void
 _elm_pan_update(Elm_Pan_Smart_Data *psd)
 {
    if (psd->content)
-     evas_object_move(psd->content, psd->x - psd->px, psd->y - psd->py);
+     {
+        Efl_Ui_Focus_Manager *manager;
+
+        manager = psd->interface_object;
+
+        efl_ui_focus_manager_dirty_logic_freeze(manager);
+        evas_object_move(psd->content, psd->x - psd->px, psd->y - psd->py);
+        efl_ui_focus_manager_dirty_logic_unfreeze(manager);
+     }
 }
 
 EOLIAN static void
@@ -4755,6 +4763,8 @@ _elm_interface_scrollable_scrollable_content_set(Eo *obj, Elm_Scrollable_Smart_I
    if (!sid->pan_obj)
      {
         o = _elm_pan_add(evas_object_evas_get(obj));
+        ELM_PAN_DATA_GET_OR_RETURN(o, pd);
+        pd->interface_object = obj;
         sid->pan_obj = o;
         efl_event_callback_add
           (o, ELM_PAN_EVENT_CHANGED, _elm_scroll_pan_changed_cb, sid);
index 85f274f..894b892 100644 (file)
@@ -46,6 +46,7 @@ struct _Elm_Pan_Smart_Data
 {
    Evas_Object                   *self;
    Evas_Object                   *content;
+   Evas_Object                   *interface_object;
    Evas_Coord                     x, y, w, h;
    Evas_Coord                     content_w, content_h, px, py;
 };