summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean@guyomarch.bzh>2017-03-08 08:57:37 +0100
committerJean Guyomarc'h <jean@guyomarch.bzh>2017-03-08 08:59:59 +0100
commitb9ab5f68aff23349a1c63079dbbed48d7cdf0c3d (patch)
tree76350bb90b39ce721dfa1d242a0e2efc8dc857c6
parent1c772ddd3ddc1d543ab3f5347993330bad005025 (diff)
ecore_evas_cocoa: remove a lot of useless code
I still don't know what's going on with the rendering problems, but at least now I have less dead code in my way...
-rw-r--r--src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c109
1 files changed, 42 insertions, 67 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 04a8b218ba..90071de6d7 100644
--- a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
+++ b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
@@ -42,32 +42,15 @@ _render_updates_process(Ecore_Evas *ee, Eina_List *updates)
42{ 42{
43 int rend = 0; 43 int rend = 0;
44 44
45 if (ee->prop.avoid_damage) 45 if (((ee->visible) && (ee->draw_ok)) ||
46 ((ee->should_be_visible) && (ee->prop.fullscreen)) ||
47 ((ee->should_be_visible) && (ee->prop.override)))
46 { 48 {
47 if (updates) 49 if (updates)
48 { 50 {
49 _ecore_evas_idle_timeout_update(ee); 51 _ecore_evas_idle_timeout_update(ee);
50 rend = 1; 52 rend = 1;
51 } 53 }
52
53 }
54 else if (((ee->visible) && (ee->draw_ok)) ||
55 ((ee->should_be_visible) && (ee->prop.fullscreen)) ||
56 ((ee->should_be_visible) && (ee->prop.override)))
57 {
58 if (updates)
59 {
60 if (ee->shaped)
61 {
62 //TODO
63 }
64 if (ee->alpha)
65 {
66 //TODO
67 }
68 _ecore_evas_idle_timeout_update(ee);
69 rend = 1;
70 }
71 } 54 }
72 else 55 else
73 evas_norender(ee->evas); 56 evas_norender(ee->evas);
@@ -99,9 +82,8 @@ static int
99_ecore_evas_cocoa_render(Ecore_Evas *ee) 82_ecore_evas_cocoa_render(Ecore_Evas *ee)
100{ 83{
101 int rend = 0; 84 int rend = 0;
102 Eina_List *ll; 85 Eina_List *ll, *updates;
103 Ecore_Evas *ee2; 86 Ecore_Evas *ee2;
104 static int render2 = -1;
105 87
106 if ((!ee->no_comp_sync) && (_ecore_evas_app_comp_sync)) 88 if ((!ee->no_comp_sync) && (_ecore_evas_app_comp_sync))
107 return 0; 89 return 0;
@@ -121,42 +103,11 @@ _ecore_evas_cocoa_render(Ecore_Evas *ee)
121 } 103 }
122 104
123 if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee); 105 if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
124 if (render2 == -1) 106
125 { 107 updates = evas_render_updates(ee->evas);
126 if (getenv("RENDER2")) render2 = 1; 108 rend = _render_updates_process(ee, updates);
127 else render2 = 0; 109 evas_render_updates_free(updates);
128 } 110
129 if (render2)
130 {
131 if (!ee->can_async_render)
132 {
133 Eina_List *updates = evas_render2_updates(ee->evas);
134 rend = _render_updates_process(ee, updates);
135 evas_render_updates_free(updates);
136 }
137 else
138 {
139 ee->in_async_render = EINA_TRUE;
140 if (evas_render2(ee->evas)) rend = 1;
141 else ee->in_async_render = EINA_FALSE;
142 }
143 }
144 else
145 {
146 if (!ee->can_async_render)
147 {
148 Eina_List *updates = evas_render_updates(ee->evas);
149 rend = _render_updates_process(ee, updates);
150 evas_render_updates_free(updates);
151 }
152 else if (evas_render_async(ee->evas))
153 {
154 DBG("ee=%p started asynchronous render.", ee);
155 ee->in_async_render = EINA_TRUE;
156 rend = 1;
157 }
158 else if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
159 }
160 return rend; 111 return rend;
161} 112}
162 113
@@ -219,7 +170,7 @@ _ecore_evas_resize_common(Ecore_Evas *ee,
219 { 170 {
220 ee->w = w; 171 ee->w = w;
221 ee->h = h; 172 ee->h = h;
222 if (ee->prop.window && resize_cocoa) 173 if (resize_cocoa)
223 ecore_cocoa_window_resize((Ecore_Cocoa_Window *)ee->prop.window, w, h); 174 ecore_cocoa_window_resize((Ecore_Cocoa_Window *)ee->prop.window, w, h);
224 175
225 if (ECORE_EVAS_PORTRAIT(ee)) 176 if (ECORE_EVAS_PORTRAIT(ee))
@@ -339,6 +290,12 @@ _ecore_evas_cocoa_free(Ecore_Evas *ee)
339} 290}
340 291
341static void 292static void
293_ecore_evas_callback_resize_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
294{
295 if (ee) ee->func.fn_resize = func;
296}
297
298static void
342_ecore_evas_size_min_set(Ecore_Evas *ee, int w, int h) 299_ecore_evas_size_min_set(Ecore_Evas *ee, int w, int h)
343{ 300{
344 ecore_cocoa_window_size_min_set((Ecore_Cocoa_Window *)ee->prop.window, w, h); 301 ecore_cocoa_window_size_min_set((Ecore_Cocoa_Window *)ee->prop.window, w, h);
@@ -400,12 +357,21 @@ static void
400_ecore_evas_show(Ecore_Evas *ee) 357_ecore_evas_show(Ecore_Evas *ee)
401{ 358{
402 DBG(""); 359 DBG("");
360
361 if (ee->visible) return;
362 ee->visible = 1;
403 ee->should_be_visible = 1; 363 ee->should_be_visible = 1;
404 if (ee->prop.avoid_damage) 364 ee->draw_ok = EINA_TRUE;
405 _ecore_evas_cocoa_render(ee);
406 365
407 ecore_cocoa_window_show((Ecore_Cocoa_Window *)ee->prop.window); 366 ecore_cocoa_window_show((Ecore_Cocoa_Window *)ee->prop.window);
408 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); 367 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
368
369 _ecore_evas_cocoa_render(ee);
370
371 ee->prop.withdrawn = EINA_FALSE;
372 if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
373
374 if (ee->func.fn_show) ee->func.fn_show(ee);
409} 375}
410 376
411 377
@@ -415,7 +381,19 @@ _ecore_evas_hide(Ecore_Evas *ee)
415 DBG(""); 381 DBG("");
416 382
417 ecore_cocoa_window_hide((Ecore_Cocoa_Window *)ee->prop.window); 383 ecore_cocoa_window_hide((Ecore_Cocoa_Window *)ee->prop.window);
384
385 if (ee->prop.override)
386 {
387 ee->prop.withdrawn = EINA_TRUE;
388 if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
389 }
390
391 if (!ee->visible) return;
392 ee->visible = 0;
418 ee->should_be_visible = 0; 393 ee->should_be_visible = 0;
394 ee->draw_ok = EINA_FALSE;
395
396 if (ee->func.fn_hide) ee->func.fn_hide(ee);
419} 397}
420 398
421static void 399static void
@@ -547,7 +525,7 @@ _ecore_evas_callback_delete_request_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func
547static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func = 525static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func =
548 { 526 {
549 _ecore_evas_cocoa_free, 527 _ecore_evas_cocoa_free,
550 NULL, 528 _ecore_evas_callback_resize_set,
551 NULL, 529 NULL,
552 NULL, 530 NULL,
553 NULL, 531 NULL,
@@ -657,11 +635,11 @@ ecore_evas_cocoa_new_internal(Ecore_Cocoa_Window *parent EINA_UNUSED, int x, int
657 635
658 _ecore_evas_cocoa_init(); 636 _ecore_evas_cocoa_init();
659 637
660 ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_cocoa_engine_func; 638 ee->engine.func = &_ecore_cocoa_engine_func;
661 639
662 if (w < 1) w = 1; 640 if (w < 1) w = 1;
663 if (h < 1) h = 1; 641 if (h < 1) h = 1;
664 ee->visible = 1; 642 ee->visible = 0;
665 ee->x = x; 643 ee->x = x;
666 ee->y = y; 644 ee->y = y;
667 ee->w = w; 645 ee->w = w;
@@ -671,14 +649,11 @@ ecore_evas_cocoa_new_internal(Ecore_Cocoa_Window *parent EINA_UNUSED, int x, int
671 ee->req.w = ee->w - ee->y; 649 ee->req.w = ee->w - ee->y;
672 ee->req.h = ee->h; 650 ee->req.h = ee->h;
673 651
674 ee->semi_sync = 1;
675
676 ee->prop.max.w = 32767; 652 ee->prop.max.w = 32767;
677 ee->prop.max.h = 32767; 653 ee->prop.max.h = 32767;
678 ee->prop.layer = 4; 654 ee->prop.layer = 4;
679 ee->prop.request_pos = EINA_FALSE; 655 ee->prop.request_pos = EINA_FALSE;
680 ee->prop.sticky = EINA_FALSE; 656 ee->prop.sticky = EINA_FALSE;
681 ee->prop.window = 0;
682 ee->prop.withdrawn = EINA_TRUE; 657 ee->prop.withdrawn = EINA_TRUE;
683 658
684 ee->evas = evas_new(); 659 ee->evas = evas_new();