summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-08-29 21:18:04 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-08-29 21:18:04 +0900
commit42a46214c4f9b35c0e1f5a84c56ea76ba2235eae (patch)
tree00a46d84cf39424623e50ed19403ff36af01146a
parent70f443d8a8e1dcf9e9f163190ffc228ace6660de (diff)
other async render issue - sync ALL rendering canvases, not just one
-rw-r--r--src/lib/evas/canvas/evas_render.c2
-rw-r--r--src/lib/evas/common/evas_thread_render.c21
-rw-r--r--src/lib/evas/include/evas_common_private.h4
3 files changed, 25 insertions, 2 deletions
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index b04d606ed0..4fbe9e2a62 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -2235,6 +2235,7 @@ _canvas_render_dump(Eo *eo_e EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
2235 Evas_Public_Data *e = _pd; 2235 Evas_Public_Data *e = _pd;
2236 Evas_Layer *lay; 2236 Evas_Layer *lay;
2237 2237
2238 evas_thread_queue_block();
2238 evas_render_rendering_wait(e); 2239 evas_render_rendering_wait(e);
2239 evas_cache_async_freeze(); 2240 evas_cache_async_freeze();
2240 2241
@@ -2263,6 +2264,7 @@ _canvas_render_dump(Eo *eo_e EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
2263 GC_ALL(evas_object_image_load_opts_cow); 2264 GC_ALL(evas_object_image_load_opts_cow);
2264 GC_ALL(evas_object_image_state_cow); 2265 GC_ALL(evas_object_image_state_cow);
2265 evas_cache_async_thaw(); 2266 evas_cache_async_thaw();
2267 evas_thread_queue_unblock();
2266} 2268}
2267 2269
2268void 2270void
diff --git a/src/lib/evas/common/evas_thread_render.c b/src/lib/evas/common/evas_thread_render.c
index f37f43a6f7..3474469450 100644
--- a/src/lib/evas/common/evas_thread_render.c
+++ b/src/lib/evas/common/evas_thread_render.c
@@ -4,6 +4,7 @@
4 4
5static Eina_Thread evas_thread_worker; 5static Eina_Thread evas_thread_worker;
6static Eina_Condition evas_thread_queue_condition; 6static Eina_Condition evas_thread_queue_condition;
7static Eina_Lock evas_thread_block_lock;
7static Eina_Lock evas_thread_queue_lock; 8static Eina_Lock evas_thread_queue_lock;
8static Eina_Bool evas_thread_queue_ready = EINA_FALSE; 9static Eina_Bool evas_thread_queue_ready = EINA_FALSE;
9static Eina_Inarray evas_thread_queue; 10static Eina_Inarray evas_thread_queue;
@@ -55,7 +56,19 @@ evas_thread_queue_flush(Evas_Thread_Command_Cb cb, void *data)
55 evas_thread_queue_append(cb, data, EINA_TRUE); 56 evas_thread_queue_append(cb, data, EINA_TRUE);
56} 57}
57 58
58static void* 59EAPI void
60evas_thread_queue_block(void)
61{
62 eina_lock_take(&evas_thread_block_lock);
63}
64
65EAPI void
66evas_thread_queue_unblock(void)
67{
68 eina_lock_release(&evas_thread_block_lock);
69}
70
71static void *
59evas_thread_worker_func(void *data EINA_UNUSED, Eina_Thread thread EINA_UNUSED) 72evas_thread_worker_func(void *data EINA_UNUSED, Eina_Thread thread EINA_UNUSED)
60{ 73{
61 while (1) 74 while (1)
@@ -83,6 +96,8 @@ evas_thread_worker_func(void *data EINA_UNUSED, Eina_Thread thread EINA_UNUSED)
83 continue; 96 continue;
84 } 97 }
85 98
99 eina_lock_take(&evas_thread_block_lock);
100
86 cmd = evas_thread_queue.members; 101 cmd = evas_thread_queue.members;
87 evas_thread_queue.members = evas_thread_queue_cache; 102 evas_thread_queue.members = evas_thread_queue_cache;
88 evas_thread_queue_cache = cmd; 103 evas_thread_queue_cache = cmd;
@@ -109,6 +124,7 @@ evas_thread_worker_func(void *data EINA_UNUSED, Eina_Thread thread EINA_UNUSED)
109 cmd++; 124 cmd++;
110 len--; 125 len--;
111 } 126 }
127 eina_lock_release(&evas_thread_block_lock);
112 } 128 }
113 129
114out: 130out:
@@ -128,6 +144,8 @@ evas_thread_init(void)
128 144
129 if (!eina_lock_new(&evas_thread_queue_lock)) 145 if (!eina_lock_new(&evas_thread_queue_lock))
130 CRIT("Could not create draw thread lock"); 146 CRIT("Could not create draw thread lock");
147 if (!eina_lock_new(&evas_thread_block_lock))
148 CRIT("Could not create draw thread block lock");
131 if (!eina_condition_new(&evas_thread_queue_condition, &evas_thread_queue_lock)) 149 if (!eina_condition_new(&evas_thread_queue_condition, &evas_thread_queue_lock))
132 CRIT("Could not create draw thread condition"); 150 CRIT("Could not create draw thread condition");
133 if (!eina_thread_create(&evas_thread_worker, EINA_THREAD_NORMAL, 0, 151 if (!eina_thread_create(&evas_thread_worker, EINA_THREAD_NORMAL, 0,
@@ -154,6 +172,7 @@ evas_thread_shutdown(void)
154 evas_async_events_process(); 172 evas_async_events_process();
155 173
156 eina_thread_join(evas_thread_worker); 174 eina_thread_join(evas_thread_worker);
175 eina_lock_free(&evas_thread_block_lock);
157 eina_lock_free(&evas_thread_queue_lock); 176 eina_lock_free(&evas_thread_queue_lock);
158 eina_condition_free(&evas_thread_queue_condition); 177 eina_condition_free(&evas_thread_queue_condition);
159 178
diff --git a/src/lib/evas/include/evas_common_private.h b/src/lib/evas/include/evas_common_private.h
index 336b7a6231..24c9d87d4a 100644
--- a/src/lib/evas/include/evas_common_private.h
+++ b/src/lib/evas/include/evas_common_private.h
@@ -1253,7 +1253,9 @@ void evas_thread_init(void);
1253void evas_thread_shutdown(void); 1253void evas_thread_shutdown(void);
1254EAPI void evas_thread_cmd_enqueue(Evas_Thread_Command_Cb cb, void *data); 1254EAPI void evas_thread_cmd_enqueue(Evas_Thread_Command_Cb cb, void *data);
1255EAPI void evas_thread_queue_flush(Evas_Thread_Command_Cb cb, void *data); 1255EAPI void evas_thread_queue_flush(Evas_Thread_Command_Cb cb, void *data);
1256 1256EAPI void evas_thread_queue_block(void);
1257EAPI void evas_thread_queue_unblock(void);
1258
1257typedef enum _Evas_Render_Mode 1259typedef enum _Evas_Render_Mode
1258{ 1260{
1259 EVAS_RENDER_MODE_UNDEF, 1261 EVAS_RENDER_MODE_UNDEF,