summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubodh Kumar <s7158.kumar@samsung.com>2015-05-15 14:18:08 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-05-15 14:19:31 +0900
commitbb13b45e800f34350a33540c22efa1c5a376ac70 (patch)
tree006f68b13a63b123fb06ed1e51479198dbdc205e
parentdf999265b0025ab94d8c2263d7d1a0a405f60e01 (diff)
edje entry: Improves anchors handling
Summary: When edje entry is not inside the canvas view port, anchors update is aborted to improve the scrolling performance in case of large number of anchors. @feature Test Plan: 1. Should have many entries inside scroller. 2. Each entry should contain large number of anchors. 3. Scroll it, scrolling is not smooth. Reviewers: seoz, cedric, thiepha, woohyun, tasn, raster, shilpasingh, herdsman, JackDanielZ Reviewed By: shilpasingh Subscribers: poornima.srinivasan, rajeshps, cedric, govi Differential Revision: https://phab.enlightenment.org/D2108
-rw-r--r--AUTHORS1
-rw-r--r--src/lib/edje/edje_entry.c57
2 files changed, 54 insertions, 4 deletions
diff --git a/AUTHORS b/AUTHORS
index e9f793fdeb..fa10193f60 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -322,6 +322,7 @@ m.biliavskyi <m.biliavskyi@samsung.com>
322Vyacheslav Reutskiy <v.reutskiy@samsung.com> 322Vyacheslav Reutskiy <v.reutskiy@samsung.com>
323Kumar Navneet <k.navneet@samsung.com> 323Kumar Navneet <k.navneet@samsung.com>
324Katpagavalli Anantharaj <katpagavalli@gmail.com> 324Katpagavalli Anantharaj <katpagavalli@gmail.com>
325Subodh Kumar <s7158.kumar@samsung.com>
325 326
326Emotion 327Emotion
327------- 328-------
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index 5b73afe213..1f4fadbd21 100644
--- a/src/lib/edje/edje_entry.c
+++ b/src/lib/edje/edje_entry.c
@@ -46,6 +46,7 @@ struct _Entry
46 Eina_Bool had_sel : 1; 46 Eina_Bool had_sel : 1;
47 Eina_Bool input_panel_enable : 1; 47 Eina_Bool input_panel_enable : 1;
48 Eina_Bool prediction_allow : 1; 48 Eina_Bool prediction_allow : 1;
49 Eina_Bool anchors_updated : 1;
49 50
50#ifdef HAVE_ECORE_IMF 51#ifdef HAVE_ECORE_IMF
51 Eina_Bool have_preedit : 1; 52 Eina_Bool have_preedit : 1;
@@ -865,7 +866,7 @@ _edje_anchor_mouse_out_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA
865} 866}
866 867
867static void 868static void
868_anchors_update(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o EINA_UNUSED, Entry *en) 869_anchors_update(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entry *en)
869{ 870{
870 Eina_List *l, *ll, *range = NULL; 871 Eina_List *l, *ll, *range = NULL;
871 Evas_Coord x, y, w, h; 872 Evas_Coord x, y, w, h;
@@ -874,6 +875,9 @@ _anchors_update(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o EINA_UNUSED
874 Anchor *an; 875 Anchor *an;
875 Edje *ed = en->ed; 876 Edje *ed = en->ed;
876 877
878 /* Better not to update anchors outside the view port. */
879 if (en->anchors_updated) return;
880
877 smart = evas_object_smart_parent_get(o); 881 smart = evas_object_smart_parent_get(o);
878 clip = evas_object_clip_get(o); 882 clip = evas_object_clip_get(o);
879 x = y = w = h = -1; 883 x = y = w = h = -1;
@@ -1013,6 +1017,43 @@ _anchors_update(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o EINA_UNUSED
1013} 1017}
1014 1018
1015static void 1019static void
1020_anchors_update_check(Edje *ed, Edje_Real_Part *rp)
1021{
1022 Evas_Coord x, y, w, h;
1023 Evas_Coord vx, vy, vw, vh;
1024 Eina_Bool anchors_updated = EINA_FALSE;
1025 Entry *en;
1026
1027 en = rp->typedata.text->entry_data;
1028 x = y = w = h = -1;
1029 vx = vy = vw = vh = -1;
1030 evas_object_geometry_get(rp->object, &x, &y, &w, &h);
1031 evas_output_viewport_get(ed->base->evas, &vx, &vy, &vw, &vh);
1032 if (((y + h) <= vy) || (y >= (vy + vh)))
1033 anchors_updated = EINA_TRUE;
1034 else if (((x + w) <= vx) || (x >= (vx + vw)))
1035 anchors_updated = EINA_TRUE;
1036
1037 if (en->anchors_updated)
1038 en->anchors_updated = anchors_updated;
1039 _anchors_update(en->cursor, rp->object, en);
1040 en->anchors_updated = anchors_updated;
1041}
1042
1043static void
1044_anchors_need_update(Edje_Real_Part *rp)
1045{
1046 Entry *en;
1047 Eina_Bool anchors_updated;
1048
1049 en = rp->typedata.text->entry_data;
1050 anchors_updated = en->anchors_updated;
1051 en->anchors_updated = EINA_FALSE;
1052 _anchors_update(en->cursor, rp->object, en);
1053 en->anchors_updated = anchors_updated;
1054}
1055
1056static void
1016_anchors_clear(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o EINA_UNUSED, Entry *en) 1057_anchors_clear(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o EINA_UNUSED, Entry *en)
1017{ 1058{
1018 while (en->anchorlist) 1059 while (en->anchorlist)
@@ -2671,7 +2712,7 @@ _edje_entry_real_part_configure(Edje *ed, Edje_Real_Part *rp)
2671 } 2712 }
2672 2713
2673 _sel_update(ed, en->cursor, rp->object, en); 2714 _sel_update(ed, en->cursor, rp->object, en);
2674 _anchors_update(en->cursor, rp->object, en); 2715 _anchors_update_check(ed, rp);
2675 x = y = w = h = -1; 2716 x = y = w = h = -1;
2676 xx = yy = ww = hh = -1; 2717 xx = yy = ww = hh = -1;
2677 evas_object_geometry_get(rp->object, &x, &y, &w, &h); 2718 evas_object_geometry_get(rp->object, &x, &y, &w, &h);
@@ -2914,6 +2955,9 @@ _edje_entry_anchor_geometry_get(Edje_Real_Part *rp, const char *anchor)
2914 (!rp->typedata.text)) return NULL; 2955 (!rp->typedata.text)) return NULL;
2915 en = rp->typedata.text->entry_data; 2956 en = rp->typedata.text->entry_data;
2916 if (!en) return NULL; 2957 if (!en) return NULL;
2958 /* Update the anchors first in case entry is not inside the canvas
2959 * viewport */
2960 _anchors_need_update(rp);
2917 EINA_LIST_FOREACH(en->anchors, l, an) 2961 EINA_LIST_FOREACH(en->anchors, l, an)
2918 { 2962 {
2919 const char *n = an->name; 2963 const char *n = an->name;
@@ -2935,6 +2979,9 @@ _edje_entry_anchors_list(Edje_Real_Part *rp)
2935 (!rp->typedata.text)) return NULL; 2979 (!rp->typedata.text)) return NULL;
2936 en = rp->typedata.text->entry_data; 2980 en = rp->typedata.text->entry_data;
2937 if (!en) return NULL; 2981 if (!en) return NULL;
2982 /* Update the anchors first in case entry is not inside the canvas
2983 * viewport */
2984 _anchors_need_update(rp);
2938 if (!en->anchorlist) 2985 if (!en->anchorlist)
2939 { 2986 {
2940 EINA_LIST_FOREACH(en->anchors, l, an) 2987 EINA_LIST_FOREACH(en->anchors, l, an)
@@ -2984,6 +3031,9 @@ _edje_entry_items_list(Edje_Real_Part *rp)
2984 (!rp->typedata.text)) return NULL; 3031 (!rp->typedata.text)) return NULL;
2985 en = rp->typedata.text->entry_data; 3032 en = rp->typedata.text->entry_data;
2986 if (!en) return NULL; 3033 if (!en) return NULL;
3034 /* Update the anchors first in case entry is not inside the canvas
3035 * viewport */
3036 _anchors_need_update(rp);
2987 if (!en->itemlist) 3037 if (!en->itemlist)
2988 { 3038 {
2989 EINA_LIST_FOREACH(en->anchors, l, an) 3039 EINA_LIST_FOREACH(en->anchors, l, an)
@@ -4294,8 +4344,7 @@ _edje_entry_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx E
4294 4344
4295 evas_textblock_cursor_range_delete(del_start, del_end); 4345 evas_textblock_cursor_range_delete(del_start, del_end);
4296 _anchors_get(en->cursor, rp->object, en); 4346 _anchors_get(en->cursor, rp->object, en);
4297 _anchors_update(en->cursor, rp->object, en); 4347 _anchors_update_check(ed, rp);
4298
4299 info = calloc(1, sizeof(*info)); 4348 info = calloc(1, sizeof(*info));
4300 info->insert = EINA_FALSE; 4349 info->insert = EINA_FALSE;
4301 info->change.del.start = start; 4350 info->change.del.start = start;