summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@samsung.com>2013-10-01 15:29:38 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-10-01 16:38:47 +0900
commit2e5a0215e613daf0ec010aed17dab1f36eb0ec3c (patch)
tree4d16847605224a3c2054d96c6c88589706ca9214
parent3b8b2ac66c10be49a85ec2dad2d54082fe47742f (diff)
evas: reduce number of relayout of text object to the strict minimum.
-rw-r--r--src/lib/evas/canvas/evas_object_text.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c
index 8fae9da593..9dc2e6e4f7 100644
--- a/src/lib/evas/canvas/evas_object_text.c
+++ b/src/lib/evas/canvas/evas_object_text.c
@@ -45,6 +45,7 @@ struct _Evas_Object_Text
45 Evas_Object_Text_Item *ellipsis_start; 45 Evas_Object_Text_Item *ellipsis_start;
46 Evas_Object_Text_Item *ellipsis_end; 46 Evas_Object_Text_Item *ellipsis_end;
47 Evas_Coord w, h; 47 Evas_Coord w, h;
48 int advance;
48 } last_computed; 49 } last_computed;
49 50
50 Evas_BiDi_Paragraph_Props *bidi_par_props; 51 Evas_BiDi_Paragraph_Props *bidi_par_props;
@@ -707,8 +708,7 @@ _evas_object_text_layout(Evas_Object *eo_obj, Evas_Object_Text *o, Eina_Unicode
707 !memcmp(&o->cur, &o->prev, sizeof (o->cur)) && 708 !memcmp(&o->cur, &o->prev, sizeof (o->cur)) &&
708 o->cur.text == text && 709 o->cur.text == text &&
709 obj->cur->scale == obj->prev->scale && 710 obj->cur->scale == obj->prev->scale &&
710 o->last_computed.w == obj->cur->geometry.w && 711 o->last_computed.advance <= obj->cur->geometry.w)
711 o->last_computed.h == obj->cur->geometry.h)
712 return; 712 return;
713 713
714 evas_object_content_change(eo_obj, obj); 714 evas_object_content_change(eo_obj, obj);
@@ -905,6 +905,7 @@ _evas_object_text_layout(Evas_Object *eo_obj, Evas_Object_Text *o, Eina_Unicode
905 if (o->cur.text != text) free(o->cur.text); 905 if (o->cur.text != text) free(o->cur.text);
906 o->cur.text = text; 906 o->cur.text = text;
907 o->prev = o->cur; 907 o->prev = o->cur;
908 o->last_computed.advance = advance;
908 909
909 _evas_object_text_item_order(eo_obj, o); 910 _evas_object_text_item_order(eo_obj, o);
910 911
@@ -2232,10 +2233,10 @@ evas_object_text_render_pre(Evas_Object *eo_obj,
2232 (obj->cur->geometry.h != o->last_computed.h))) || 2233 (obj->cur->geometry.h != o->last_computed.h))) ||
2233 (obj->cur->scale != obj->prev->scale)) 2234 (obj->cur->scale != obj->prev->scale))
2234 { 2235 {
2235 _evas_object_text_recalc(eo_obj, o->cur.text); 2236 _evas_object_text_recalc(eo_obj, o->cur.text);
2236 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, 2237 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
2237 eo_obj, obj); 2238 eo_obj, obj);
2238 goto done; 2239 goto done;
2239 } 2240 }
2240 /* now figure what changed and add draw rects 2241 /* now figure what changed and add draw rects
2241 if it just became visible or invisible */ 2242 if it just became visible or invisible */