summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-01-27 21:50:39 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-01-27 21:50:39 +0900
commitf80f73a7c9cf663ccb3db9634a72d7fcc294bd90 (patch)
tree389848b916a7fb744bb88b92cd059cfbbfad8f68
parentc06e36fa2a7261e96977ae4ff826b0d39f7233eb (diff)
e widget bgpreview - stop using livethumb as it cuases performance issues
bgp[review uses livethumb. livethumb by definition uses an image canvas with a sw engine and thus not only renders the bg with another engine, it also is causing continual texture uploads thanks to the pager and this shows clearly on slow systems. this causes memory duplication for the same wallpaper as ever bg has its own canvas and buffer etc. this does come with a quality drop though and that's up for debate. we COULD use something else like a proxy or map in between to force a higher "virtual" res vs output. but for now at least this solves both a memory bloat issue and a performance problem. @fix
-rw-r--r--src/bin/e_widget_bgpreview.c59
1 files changed, 3 insertions, 56 deletions
diff --git a/src/bin/e_widget_bgpreview.c b/src/bin/e_widget_bgpreview.c
index f66eb8063..a9b5c2d02 100644
--- a/src/bin/e_widget_bgpreview.c
+++ b/src/bin/e_widget_bgpreview.c
@@ -10,7 +10,7 @@ struct _E_Widget_Data
10typedef struct _E_Widget_Desk_Data E_Widget_Desk_Data; 10typedef struct _E_Widget_Desk_Data E_Widget_Desk_Data;
11struct _E_Widget_Desk_Data 11struct _E_Widget_Desk_Data
12{ 12{
13 Evas_Object *icon, *thumb, *live, *cont; 13 Evas_Object *icon, *live, *cont;
14 int zone, x, y; 14 int zone, x, y;
15 Ecore_Event_Handler *bg_upd_hdl; 15 Ecore_Event_Handler *bg_upd_hdl;
16 Ecore_Job *resize_job; 16 Ecore_Job *resize_job;
@@ -19,7 +19,6 @@ struct _E_Widget_Desk_Data
19 19
20/* local function prototypes */ 20/* local function prototypes */
21static void _e_wid_data_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED); 21static void _e_wid_data_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED);
22static void _e_wid_livethumb_resize(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED);
23static void _e_wid_del_hook(Evas_Object *obj); 22static void _e_wid_del_hook(Evas_Object *obj);
24static void _e_wid_reconfigure(E_Widget_Data *wd); 23static void _e_wid_reconfigure(E_Widget_Data *wd);
25static void _e_wid_desk_cb_config(void *data, Evas *evas, Evas_Object *obj, void *event); 24static void _e_wid_desk_cb_config(void *data, Evas *evas, Evas_Object *obj, void *event);
@@ -98,12 +97,9 @@ e_widget_bgpreview_desk_add(Evas *e, E_Zone *zone, int x, int y)
98 97
99 if (eina_str_has_extension(bgfile, ".edj")) 98 if (eina_str_has_extension(bgfile, ".edj"))
100 { 99 {
101 dd->live = e_livethumb_add(e); 100 dd->live = o = edje_object_add(e);
102 dd->thumb = o = edje_object_add(e_livethumb_evas_get(dd->live));
103 edje_object_file_set(o, bgfile, "e/desktop/background"); 101 edje_object_file_set(o, bgfile, "e/desktop/background");
104 _bgpreview_viewport_update(o, zone, x, y); 102 _bgpreview_viewport_update(o, zone, x, y);
105 e_livethumb_thumb_set(dd->live, o);
106 evas_object_show(dd->thumb);
107 } 103 }
108 else if ((eina_str_has_extension(bgfile, ".gif")) || 104 else if ((eina_str_has_extension(bgfile, ".gif")) ||
109 (eina_str_has_extension(bgfile, ".png")) || 105 (eina_str_has_extension(bgfile, ".png")) ||
@@ -128,7 +124,6 @@ e_widget_bgpreview_desk_add(Evas *e, E_Zone *zone, int x, int y)
128 124
129 evas_object_data_set(dd->cont, "desk_data", dd); 125 evas_object_data_set(dd->cont, "desk_data", dd);
130 evas_object_event_callback_add(dd->cont, EVAS_CALLBACK_DEL, _e_wid_data_del, dd); 126 evas_object_event_callback_add(dd->cont, EVAS_CALLBACK_DEL, _e_wid_data_del, dd);
131 evas_object_event_callback_add(dd->cont, EVAS_CALLBACK_RESIZE, _e_wid_livethumb_resize, dd);
132 127
133 dd->bg_upd_hdl = ecore_event_handler_add(E_EVENT_BG_UPDATE, 128 dd->bg_upd_hdl = ecore_event_handler_add(E_EVENT_BG_UPDATE,
134 _e_wid_cb_bg_update, dd); 129 _e_wid_cb_bg_update, dd);
@@ -155,48 +150,6 @@ e_widget_bgpreview_desk_configurable_set(Evas_Object *obj, Eina_Bool enable)
155 dd->configurable = enable; 150 dd->configurable = enable;
156} 151}
157 152
158/* local function prototypes */
159static void
160_e_wid_livethumb_resize_job(void *data)
161{
162 E_Widget_Desk_Data *dd = data;
163 E_Zone *zone;
164 int w, h;
165
166 if (dd->thumb)
167 {
168 zone = e_comp_object_util_zone_get(dd->live);
169 if (!zone) zone = eina_list_data_get(e_comp->zones);
170 evas_object_geometry_get(dd->cont, NULL, NULL, &w, &h);
171 if ((w != zone->w) || (h != zone->h))
172 {
173 w *= 2;
174 h *= 2;
175 if (w > 128)
176 {
177 w = 128;
178 h = (zone->h * w) / zone->w;
179 }
180 if (h > 128)
181 {
182 h = 128;
183 w = (zone->w * h) / zone->h;
184 }
185 }
186 e_livethumb_vsize_set(dd->live, w, h);
187 }
188 dd->resize_job = NULL;
189}
190
191static void
192_e_wid_livethumb_resize(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
193{
194 E_Widget_Desk_Data *dd = data;
195
196 if (!dd->resize_job)
197 dd->resize_job = ecore_job_add(_e_wid_livethumb_resize_job, dd);
198}
199
200static void 153static void
201_e_wid_data_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 154_e_wid_data_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
202{ 155{
@@ -359,19 +312,14 @@ _e_wid_cb_bg_update(void *data, int type, void *event)
359 zone = e_comp_zone_number_get(dd->zone); 312 zone = e_comp_zone_number_get(dd->zone);
360 bgfile = e_bg_file_get(dd->zone, dd->x, dd->y); 313 bgfile = e_bg_file_get(dd->zone, dd->x, dd->y);
361 314
362 if (dd->thumb) evas_object_del(dd->thumb);
363 dd->thumb = NULL;
364 if (dd->live) evas_object_del(dd->live); 315 if (dd->live) evas_object_del(dd->live);
365 dd->live = NULL; 316 dd->live = NULL;
366 317
367 if (eina_str_has_extension(bgfile, ".edj")) 318 if (eina_str_has_extension(bgfile, ".edj"))
368 { 319 {
369 dd->live = e_livethumb_add(e); 320 dd->live = o = edje_object_add(e);
370 dd->thumb = o = edje_object_add(e_livethumb_evas_get(dd->live));
371 edje_object_file_set(o, bgfile, "e/desktop/background"); 321 edje_object_file_set(o, bgfile, "e/desktop/background");
372 _bgpreview_viewport_update(o, zone, dd->x, dd->y); 322 _bgpreview_viewport_update(o, zone, dd->x, dd->y);
373 e_livethumb_thumb_set(dd->live, o);
374 evas_object_show(dd->thumb);
375 } 323 }
376 else if ((eina_str_has_extension(bgfile, ".gif")) || 324 else if ((eina_str_has_extension(bgfile, ".gif")) ||
377 (eina_str_has_extension(bgfile, ".png")) || 325 (eina_str_has_extension(bgfile, ".png")) ||
@@ -387,7 +335,6 @@ _e_wid_cb_bg_update(void *data, int type, void *event)
387 { 335 {
388 dd->live = o = e_video_add(e, bgfile, EINA_TRUE); 336 dd->live = o = e_video_add(e, bgfile, EINA_TRUE);
389 } 337 }
390 _e_wid_livethumb_resize_job(dd);
391 eina_stringshare_del(bgfile); 338 eina_stringshare_del(bgfile);
392 339
393 evas_object_size_hint_weight_set(dd->live, 1, 1); 340 evas_object_size_hint_weight_set(dd->live, 1, 1);