summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2005-07-28 14:09:09 +0000
committerCarsten Haitzler <raster@rasterman.com>2005-07-28 14:09:09 +0000
commita17ebe021de835ae814f6c41470ce2010ca7f64e (patch)
tree7bbfae98af86623a442070f5376d2019e7970be7 /legacy
parent3c16cf0327f848bc794c827af1aa3d6f64b58d09 (diff)
defer evas destruction until idle time :)
SVN revision: 15933
Diffstat (limited to 'legacy')
-rw-r--r--legacy/ecore/src/lib/ecore_evas/ecore_evas.c76
-rw-r--r--legacy/ecore/src/lib/ecore_evas/ecore_evas_fb.c6
-rw-r--r--legacy/ecore/src/lib/ecore_evas/ecore_evas_private.h3
-rw-r--r--legacy/ecore/src/lib/ecore_evas/ecore_evas_x.c10
4 files changed, 66 insertions, 29 deletions
diff --git a/legacy/ecore/src/lib/ecore_evas/ecore_evas.c b/legacy/ecore/src/lib/ecore_evas/ecore_evas.c
index b6e57cdf14..dfc7a31b75 100644
--- a/legacy/ecore/src/lib/ecore_evas/ecore_evas.c
+++ b/legacy/ecore/src/lib/ecore_evas/ecore_evas.c
@@ -6,6 +6,8 @@
6 6
7static int _ecore_evas_init_count = 0; 7static int _ecore_evas_init_count = 0;
8 8
9static int _ecore_evas_idle_enter_delete(void *data);
10
9/** 11/**
10 * Query if a particular renginering engine target has support 12 * Query if a particular renginering engine target has support
11 * @param engine The engine to check support for 13 * @param engine The engine to check support for
@@ -110,31 +112,10 @@ ecore_evas_free(Ecore_Evas *ee)
110 "ecore_evas_free"); 112 "ecore_evas_free");
111 return; 113 return;
112 } 114 }
113 ECORE_MAGIC_SET(ee, ECORE_MAGIC_NONE); 115 if (ee->delete_idle_enterer) return;
114 while (ee->sub_ecore_evas) 116 ee->delete_idle_enterer =
115 { 117 ecore_idle_enterer_add(_ecore_evas_idle_enter_delete, ee);
116 ecore_evas_free(ee->sub_ecore_evas->data); 118 return;
117 }
118 if (ee->data) evas_hash_free(ee->data);
119 if (ee->driver) free(ee->driver);
120 if (ee->name) free(ee->name);
121 if (ee->prop.title) free(ee->prop.title);
122 if (ee->prop.name) free(ee->prop.name);
123 if (ee->prop.clas) free(ee->prop.clas);
124 if (ee->prop.cursor.file) free(ee->prop.cursor.file);
125 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
126 if (ee->evas) evas_free(ee->evas);
127 ee->data = NULL;
128 ee->driver = NULL;
129 ee->name = NULL;
130 ee->prop.title = NULL;
131 ee->prop.name = NULL;
132 ee->prop.clas = NULL;
133 ee->prop.cursor.file = NULL;
134 ee->prop.cursor.object = NULL;
135 ee->evas = NULL;
136 if (ee->engine.func->fn_free) ee->engine.func->fn_free(ee);
137 free(ee);
138} 119}
139 120
140void * 121void *
@@ -1603,3 +1584,48 @@ _ecore_evas_fps_debug_rendertime_add(double t)
1603 } 1584 }
1604} 1585}
1605#endif 1586#endif
1587
1588void
1589_ecore_evas_free(Ecore_Evas *ee)
1590{
1591 ECORE_MAGIC_SET(ee, ECORE_MAGIC_NONE);
1592 if (ee->delete_idle_enterer)
1593 {
1594 ecore_idle_enterer_del(ee->delete_idle_enterer);
1595 ee->delete_idle_enterer = NULL;
1596 }
1597 while (ee->sub_ecore_evas)
1598 {
1599 ecore_evas_free(ee->sub_ecore_evas->data);
1600 }
1601 if (ee->data) evas_hash_free(ee->data);
1602 if (ee->driver) free(ee->driver);
1603 if (ee->name) free(ee->name);
1604 if (ee->prop.title) free(ee->prop.title);
1605 if (ee->prop.name) free(ee->prop.name);
1606 if (ee->prop.clas) free(ee->prop.clas);
1607 if (ee->prop.cursor.file) free(ee->prop.cursor.file);
1608 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
1609 if (ee->evas) evas_free(ee->evas);
1610 ee->data = NULL;
1611 ee->driver = NULL;
1612 ee->name = NULL;
1613 ee->prop.title = NULL;
1614 ee->prop.name = NULL;
1615 ee->prop.clas = NULL;
1616 ee->prop.cursor.file = NULL;
1617 ee->prop.cursor.object = NULL;
1618 ee->evas = NULL;
1619 if (ee->engine.func->fn_free) ee->engine.func->fn_free(ee);
1620 free(ee);
1621}
1622
1623static int
1624_ecore_evas_idle_enter_delete(void *data)
1625{
1626 Ecore_Evas *ee;
1627
1628 ee = (Ecore_Evas *)data;
1629 _ecore_evas_free(ee);
1630 return 0;
1631}
diff --git a/legacy/ecore/src/lib/ecore_evas/ecore_evas_fb.c b/legacy/ecore/src/lib/ecore_evas/ecore_evas_fb.c
index b0a6d2abe4..f78631e639 100644
--- a/legacy/ecore/src/lib/ecore_evas/ecore_evas_fb.c
+++ b/legacy/ecore/src/lib/ecore_evas/ecore_evas_fb.c
@@ -64,7 +64,9 @@ _ecore_evas_fb_match(void)
64 Ecore_Evas *ee; 64 Ecore_Evas *ee;
65 65
66 ee = (Ecore_Evas *)l; 66 ee = (Ecore_Evas *)l;
67 return ee; 67 if (ee->delete_idle_enterer) continue;
68 else
69 return ee;
68 } 70 }
69 return NULL; 71 return NULL;
70} 72}
@@ -404,7 +406,7 @@ _ecore_evas_fb_shutdown(void)
404 { 406 {
405 int i; 407 int i;
406 408
407 while (ecore_evases) ecore_evas_free(ecore_evases); 409 while (ecore_evases) _ecore_evas_free(ecore_evases);
408 for (i = 0; i < 5; i++) 410 for (i = 0; i < 5; i++)
409 ecore_event_handler_del(ecore_evas_event_handlers[i]); 411 ecore_event_handler_del(ecore_evas_event_handlers[i]);
410 ecore_idle_enterer_del(ecore_evas_idle_enterer); 412 ecore_idle_enterer_del(ecore_evas_idle_enterer);
diff --git a/legacy/ecore/src/lib/ecore_evas/ecore_evas_private.h b/legacy/ecore/src/lib/ecore_evas/ecore_evas_private.h
index 675816d10b..f4a3e32a3b 100644
--- a/legacy/ecore/src/lib/ecore_evas/ecore_evas_private.h
+++ b/legacy/ecore/src/lib/ecore_evas/ecore_evas_private.h
@@ -139,6 +139,8 @@ struct _Ecore_Evas
139 char visible : 1; 139 char visible : 1;
140 char should_be_visible : 1; 140 char should_be_visible : 1;
141 141
142 Ecore_Idle_Enterer *delete_idle_enterer;
143
142 Evas_Hash *data; 144 Evas_Hash *data;
143 145
144 struct { 146 struct {
@@ -212,5 +214,6 @@ void _ecore_evas_buffer_render(Ecore_Evas *ee);
212void _ecore_evas_fps_debug_init(void); 214void _ecore_evas_fps_debug_init(void);
213void _ecore_evas_fps_debug_shutdown(void); 215void _ecore_evas_fps_debug_shutdown(void);
214void _ecore_evas_fps_debug_rendertime_add(double t); 216void _ecore_evas_fps_debug_rendertime_add(double t);
217void _ecore_evas_free(Ecore_Evas *ee);
215 218
216#endif 219#endif
diff --git a/legacy/ecore/src/lib/ecore_evas/ecore_evas_x.c b/legacy/ecore/src/lib/ecore_evas/ecore_evas_x.c
index 243ddb6141..d168df4ed0 100644
--- a/legacy/ecore/src/lib/ecore_evas/ecore_evas_x.c
+++ b/legacy/ecore/src/lib/ecore_evas/ecore_evas_x.c
@@ -27,12 +27,14 @@ _ecore_evas_x_render(Ecore_Evas *ee)
27 Evas_List *ll; 27 Evas_List *ll;
28#endif 28#endif
29 29
30 if (ee->delete_idle_enterer) return;
30#ifdef BUILD_ECORE_EVAS_BUFFER 31#ifdef BUILD_ECORE_EVAS_BUFFER
31 for (ll = ee->sub_ecore_evas; ll; ll = ll->next) 32 for (ll = ee->sub_ecore_evas; ll; ll = ll->next)
32 { 33 {
33 Ecore_Evas *ee2; 34 Ecore_Evas *ee2;
34 35
35 ee2 = ll->data; 36 ee2 = ll->data;
37 if (ee2->delete_idle_enterer) continue;
36 if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2); 38 if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
37 _ecore_evas_buffer_render(ee2); 39 _ecore_evas_buffer_render(ee2);
38 if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2); 40 if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
@@ -250,7 +252,11 @@ _ecore_evas_x_winid_str_get(Ecore_X_Window win)
250static Ecore_Evas * 252static Ecore_Evas *
251_ecore_evas_x_match(Ecore_X_Window win) 253_ecore_evas_x_match(Ecore_X_Window win)
252{ 254{
253 return evas_hash_find(ecore_evases_hash, _ecore_evas_x_winid_str_get(win)); 255 Ecore_Evas *ee;
256
257 ee = evas_hash_find(ecore_evases_hash, _ecore_evas_x_winid_str_get(win));
258 if ((ee) && (ee->delete_idle_enterer)) return NULL;
259 return ee;
254} 260}
255 261
256static void 262static void
@@ -1500,7 +1506,7 @@ _ecore_evas_x_shutdown(void)
1500 { 1506 {
1501 int i; 1507 int i;
1502 1508
1503 while (ecore_evases) ecore_evas_free(ecore_evases); 1509 while (ecore_evases) _ecore_evas_free(ecore_evases);
1504 for (i = 0; i < 16; i++) 1510 for (i = 0; i < 16; i++)
1505 ecore_event_handler_del(ecore_evas_event_handlers[i]); 1511 ecore_event_handler_del(ecore_evas_event_handlers[i]);
1506 ecore_idle_enterer_del(ecore_evas_idle_enterer); 1512 ecore_idle_enterer_del(ecore_evas_idle_enterer);