summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2013-09-29 18:57:10 +0900
committerChunEon Park <hermet@hermet.pe.kr>2013-09-29 18:57:10 +0900
commit458b46544b5062212fdfb695607723a6c7a86ce5 (patch)
tree3d82aae1654fc075b533823d2cf51d275345e135
parentd8caa8077b048833680608636fffe68ad343ef64 (diff)
elementary/mapbuf: Dont' move the content to not be calculated. Mapbuf expects
the content is static object and it won't be updated by content position. This actually reduces the mapbuf calculation time muchly in case of complex layout.
-rw-r--r--ChangeLog7
-rw-r--r--NEWS4
-rw-r--r--src/lib/elm_mapbuf.c53
3 files changed, 31 insertions, 33 deletions
diff --git a/ChangeLog b/ChangeLog
index 884807c8a..7dc0c7ac2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1652,3 +1652,10 @@
16522013-09-27 ChunEon Park (Hermet) 16522013-09-27 ChunEon Park (Hermet)
1653 1653
1654 * layout: fixed the layout to swallow the contents again when theme is changed. 1654 * layout: fixed the layout to swallow the contents again when theme is changed.
1655
16562013-09-29 ChunEon Park (Hermet)
1657
1658 * mapbuf: Dont' move the content to not be calculated. Mapbuf expects
1659 the content is static object and it won't be updated by content
1660 position. This actually reduces the mapbuf calculation time muchly in
1661 case of complex layout.
diff --git a/NEWS b/NEWS
index a974127fb..d31e51ab7 100644
--- a/NEWS
+++ b/NEWS
@@ -141,6 +141,10 @@ Improvements:
141 * Add hide effect for notify. 141 * Add hide effect for notify.
142 * Widget: Improve performance in applying widget theme. It prevents applying themes more strictly if it tries to apply same theme. This increases the performance hugely in case that user applies a specific theme to the window object. 142 * Widget: Improve performance in applying widget theme. It prevents applying themes more strictly if it tries to apply same theme. This increases the performance hugely in case that user applies a specific theme to the window object.
143 * Flip now sets the focus to it's content object when flip go to is called while flip is focused. 143 * Flip now sets the focus to it's content object when flip go to is called while flip is focused.
144 * mapbuf: Dont' move the content to not be calculated. Mapbuf expects the
145 content is static object and it won't be updated by content position.
146 This actually reduces the mapbuf calculation time muchly in case of complex
147 layout.
144 148
145Fixes: 149Fixes:
146 * Now elm_datetime_field_limit_set() can set year limits wihtout problems. 150 * Now elm_datetime_field_limit_set() can set year limits wihtout problems.
diff --git a/src/lib/elm_mapbuf.c b/src/lib/elm_mapbuf.c
index 566bb96d7..dd8dee2fa 100644
--- a/src/lib/elm_mapbuf.c
+++ b/src/lib/elm_mapbuf.c
@@ -82,7 +82,7 @@ _elm_mapbuf_smart_sub_object_del(Eo *obj, void *_pd, va_list *list)
82} 82}
83 83
84static void 84static void
85_configure(Evas_Object *obj, Eina_Bool update_force) 85_configure(Evas_Object *obj)
86{ 86{
87 ELM_MAPBUF_DATA_GET(obj, sd); 87 ELM_MAPBUF_DATA_GET(obj, sd);
88 Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); 88 Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS);
@@ -91,33 +91,20 @@ _configure(Evas_Object *obj, Eina_Bool update_force)
91 91
92 if (!sd->content) return; 92 if (!sd->content) return;
93 93
94 Evas_Coord x, y, w, h, x2, y2, w2, h2; 94 Evas_Coord x, y, w, h;
95 evas_object_geometry_get(wd->resize_obj, &x, &y, &w, &h); 95 evas_object_geometry_get(wd->resize_obj, &x, &y, &w, &h);
96 evas_object_geometry_get(sd->content, &x2, &y2, &w2, &h2);
97 96
98 if ((update_force) || ((x != x2) || (y != y2) || (w != w2) || (h != h2))) 97 if (sd->enabled)
99 { 98 {
100 if (sd->enabled) 99 if (!m) m = evas_map_new(4);
101 { 100 evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0);
102 Evas *e = evas_object_evas_get(obj); 101 evas_map_smooth_set(m, sd->smooth);
103/* This causes many side effects in calculating mapbuf objects. 102 evas_map_alpha_set(m, sd->alpha);
104 But it doesn't affect to the mapbuf it's own special feature, performance. */ 103 evas_object_map_set(sd->content, m);
105// evas_smart_objects_calculate(e); 104 evas_object_map_enable_set(sd->content, EINA_TRUE);
106 evas_nochange_push(e);
107 evas_object_move(sd->content, x, y);
108// evas_smart_objects_calculate(e);
109 evas_nochange_pop(e);
110
111 if (!m) m = evas_map_new(4);
112 evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0);
113 evas_map_smooth_set(m, sd->smooth);
114 evas_map_alpha_set(m, sd->alpha);
115 evas_object_map_set(sd->content, m);
116 evas_object_map_enable_set(sd->content, EINA_TRUE);
117 }
118 else
119 evas_object_move(sd->content, x, y);
120 } 105 }
106 else
107 evas_object_move(sd->content, x, y);
121} 108}
122 109
123static void 110static void
@@ -165,7 +152,7 @@ _elm_mapbuf_smart_move(Eo *obj, void *_pd, va_list *list)
165 152
166 _mapbuf_auto_eval(obj, _pd); 153 _mapbuf_auto_eval(obj, _pd);
167 _mapbuf_auto_smooth(obj, _pd); 154 _mapbuf_auto_smooth(obj, _pd);
168 _configure(obj, EINA_FALSE); 155 _configure(obj);
169} 156}
170 157
171static void 158static void
@@ -178,7 +165,7 @@ _elm_mapbuf_smart_resize(Eo *obj, void *_pd, va_list *list)
178 ELM_MAPBUF_DATA_GET(obj, sd); 165 ELM_MAPBUF_DATA_GET(obj, sd);
179 if (sd->content) evas_object_resize(sd->content, w, h); 166 if (sd->content) evas_object_resize(sd->content, w, h);
180 _mapbuf_auto_eval(obj, _pd); 167 _mapbuf_auto_eval(obj, _pd);
181 _configure(obj, EINA_FALSE); 168 _configure(obj);
182} 169}
183 170
184static void 171static void
@@ -187,7 +174,7 @@ _elm_mapbuf_smart_show(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
187 eo_do_super(obj, MY_CLASS, evas_obj_smart_show()); 174 eo_do_super(obj, MY_CLASS, evas_obj_smart_show());
188 175
189 _mapbuf_auto_eval(obj, _pd); 176 _mapbuf_auto_eval(obj, _pd);
190 _configure(obj, EINA_FALSE); 177 _configure(obj);
191} 178}
192 179
193static void 180static void
@@ -196,7 +183,7 @@ _elm_mapbuf_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
196 eo_do_super(obj, MY_CLASS, evas_obj_smart_hide()); 183 eo_do_super(obj, MY_CLASS, evas_obj_smart_hide());
197 184
198 _mapbuf_auto_eval(obj, _pd); 185 _mapbuf_auto_eval(obj, _pd);
199 _configure(obj, EINA_FALSE); 186 _configure(obj);
200} 187}
201 188
202static void 189static void
@@ -235,7 +222,7 @@ _elm_mapbuf_smart_content_set(Eo *obj, void *_pd, va_list *list)
235 evas_object_color_set(wd->resize_obj, 0, 0, 0, 0); 222 evas_object_color_set(wd->resize_obj, 0, 0, 0, 0);
236 223
237 _sizing_eval(obj); 224 _sizing_eval(obj);
238 _configure(obj, EINA_TRUE); 225 _configure(obj);
239 226
240 if (ret) *ret = EINA_TRUE; 227 if (ret) *ret = EINA_TRUE;
241} 228}
@@ -348,7 +335,7 @@ _internal_enable_set(Eo *obj, Elm_Mapbuf_Smart_Data *sd, Eina_Bool enabled)
348 evas_object_map_set(sd->content, NULL); 335 evas_object_map_set(sd->content, NULL);
349 evas_object_map_enable_set(sd->content, EINA_FALSE); 336 evas_object_map_enable_set(sd->content, EINA_FALSE);
350 } 337 }
351 _configure(obj, EINA_TRUE); 338 _configure(obj);
352} 339}
353 340
354static void 341static void
@@ -394,7 +381,7 @@ _smooth_set(Eo *obj, void *_pd, va_list *list)
394 if (sd->smooth == smooth) return; 381 if (sd->smooth == smooth) return;
395 sd->smooth = smooth; 382 sd->smooth = smooth;
396 sd->smooth_saved = smooth; 383 sd->smooth_saved = smooth;
397 _configure(obj, EINA_TRUE); 384 _configure(obj);
398} 385}
399 386
400EAPI Eina_Bool 387EAPI Eina_Bool
@@ -430,7 +417,7 @@ _alpha_set(Eo *obj, void *_pd, va_list *list)
430 417
431 if (sd->alpha == alpha) return; 418 if (sd->alpha == alpha) return;
432 sd->alpha = alpha; 419 sd->alpha = alpha;
433 _configure(obj, EINA_TRUE); 420 _configure(obj);
434} 421}
435 422
436EAPI Eina_Bool 423EAPI Eina_Bool
@@ -476,7 +463,7 @@ _auto_set(Eo *obj, void *_pd, va_list *list)
476 463
477 _internal_enable_set(obj, _pd, EINA_FALSE); 464 _internal_enable_set(obj, _pd, EINA_FALSE);
478 } 465 }
479 _configure(obj, EINA_TRUE); 466 _configure(obj);
480} 467}
481 468
482EAPI Eina_Bool 469EAPI Eina_Bool