summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean@guyomarch.bzh>2017-03-08 21:20:55 +0100
committerJean Guyomarc'h <jean@guyomarch.bzh>2017-03-09 00:57:55 +0100
commit79e7e2628a881540f35b64f515938b31a136c674 (patch)
tree639a486ce82501e0ec4428b31b292dac167292ec
parent4766316935589b6191e047ad697ab10ae2027a43 (diff)
ecore_evas_cocoa: remove more pointless code
-rw-r--r--src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c79
1 files changed, 17 insertions, 62 deletions
diff --git a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
index 90071de6d7..6a61a7bf20 100644
--- a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
+++ b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
@@ -38,62 +38,12 @@ static const char *_iface_name = "opengl_cocoa";
38static const int _iface_version = 1; 38static const int _iface_version = 1;
39 39
40static int 40static int
41_render_updates_process(Ecore_Evas *ee, Eina_List *updates)
42{
43 int rend = 0;
44
45 if (((ee->visible) && (ee->draw_ok)) ||
46 ((ee->should_be_visible) && (ee->prop.fullscreen)) ||
47 ((ee->should_be_visible) && (ee->prop.override)))
48 {
49 if (updates)
50 {
51 _ecore_evas_idle_timeout_update(ee);
52 rend = 1;
53 }
54 }
55 else
56 evas_norender(ee->evas);
57
58 if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
59
60
61 if (rend)
62 {
63 static int frames = 0;
64 static double t0 = 0.0;
65 double t, td;
66
67 t = ecore_time_get();
68 frames++;
69 if ((t - t0) > 1.0)
70 {
71 td = t - t0;
72 DBG("FPS: %3.3f", (double)frames / td);
73 frames = 0;
74 t0 = t;
75 }
76 }
77
78 return rend;
79}
80
81static int
82_ecore_evas_cocoa_render(Ecore_Evas *ee) 41_ecore_evas_cocoa_render(Ecore_Evas *ee)
83{ 42{
84 int rend = 0; 43 int rend = 0;
85 Eina_List *ll, *updates; 44 Eina_List *ll, *updates = NULL;
86 Ecore_Evas *ee2; 45 Ecore_Evas *ee2;
87 46
88 if ((!ee->no_comp_sync) && (_ecore_evas_app_comp_sync))
89 return 0;
90
91 if (ee->in_async_render)
92 {
93 DBG("ee=%p is rendering asynchronously, skip.", ee);
94 return 0;
95 }
96
97 EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2) 47 EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
98 { 48 {
99 if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2); 49 if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
@@ -104,11 +54,19 @@ _ecore_evas_cocoa_render(Ecore_Evas *ee)
104 54
105 if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee); 55 if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
106 56
107 updates = evas_render_updates(ee->evas); 57 if (((ee->visible) && (ee->draw_ok)) ||
108 rend = _render_updates_process(ee, updates); 58 ((ee->should_be_visible) && (ee->prop.fullscreen)) ||
109 evas_render_updates_free(updates); 59 ((ee->should_be_visible) && (ee->prop.override)))
60 {
61 updates = evas_render_updates(ee->evas);
62 if (updates) evas_render_updates_free(updates);
63 }
64 else
65 evas_norender(ee->evas);
110 66
111 return rend; 67 if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
68
69 return (updates) ? 1 : rend;
112} 70}
113 71
114 72
@@ -358,19 +316,16 @@ _ecore_evas_show(Ecore_Evas *ee)
358{ 316{
359 DBG(""); 317 DBG("");
360 318
361 if (ee->visible) return;
362 ee->visible = 1;
363 ee->should_be_visible = 1;
364 ee->draw_ok = EINA_TRUE;
365
366 ecore_cocoa_window_show((Ecore_Cocoa_Window *)ee->prop.window); 319 ecore_cocoa_window_show((Ecore_Cocoa_Window *)ee->prop.window);
367 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); 320 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
368 321
369 _ecore_evas_cocoa_render(ee);
370
371 ee->prop.withdrawn = EINA_FALSE; 322 ee->prop.withdrawn = EINA_FALSE;
372 if (ee->func.fn_state_change) ee->func.fn_state_change(ee); 323 if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
373 324
325 if (ee->visible) return;
326 ee->visible = 1;
327 ee->should_be_visible = 1;
328 ee->draw_ok = EINA_TRUE;
374 if (ee->func.fn_show) ee->func.fn_show(ee); 329 if (ee->func.fn_show) ee->func.fn_show(ee);
375} 330}
376 331