ecore_evas_extn: remove old buffer in evas render post function.
authorJi-Youn Park <jy0703.park@samsung.com>
Wed, 23 Sep 2015 06:34:02 +0000 (15:04 +0830)
committerJi-Youn Park <jy0703.park@samsung.com>
Wed, 23 Sep 2015 06:34:02 +0000 (15:04 +0830)
Before, ipc_server_data(fd handler callback) is not runned between
evas_render_pre callback and evas_render_post callback.
but after async mode, hd handler can be called between render_pre and render_post.
we should remove buffer which can be used render thread, after render finished

src/modules/ecore_evas/engines/extn/ecore_evas_extn.c

index c8ef291..e280bbc 100644 (file)
@@ -116,6 +116,12 @@ _ecore_evas_extn_plug_render_post(void *data, Evas *e EINA_UNUSED, void *event_i
    extn = bdata->data;
    if (!extn) return;
    _extnbuf_unlock(extn->b[extn->cur_b].buf);
+   if (extn->b[extn->cur_b].obuf)
+     {
+        _extnbuf_unlock(extn->b[extn->cur_b].obuf);
+        _extnbuf_free(extn->b[extn->cur_b].obuf);
+        extn->b[extn->cur_b].obuf = NULL;
+     }
 }
 
 static void
@@ -1015,12 +1021,6 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void *event)
                    extn->cur_b = n;
 
                    if (extn->b[pn].buf) _extnbuf_unlock(extn->b[pn].buf);
-                   if (extn->b[pn].obuf)
-                     {
-                        _extnbuf_unlock(extn->b[pn].obuf);
-                        _extnbuf_free(extn->b[pn].obuf);
-                        extn->b[pn].obuf = NULL;
-                     }
 
                    evas_object_image_colorspace_set(bdata->image, EVAS_COLORSPACE_ARGB8888);
                    if (extn->b[n].buf)
@@ -1258,6 +1258,12 @@ ecore_evas_extn_plug_new_internal(Ecore_Evas *ee_target)
 
    extn_ee_list = eina_list_append(extn_ee_list, ee);
    ee_target->sub_ecore_evas = eina_list_append(ee_target->sub_ecore_evas, ee);
+
+   evas_event_callback_add(ee_target->evas, EVAS_CALLBACK_RENDER_PRE,
+                           _ecore_evas_extn_plug_render_pre, ee);
+   evas_event_callback_add(ee_target->evas, EVAS_CALLBACK_RENDER_POST,
+                           _ecore_evas_extn_plug_render_post, ee);
+
    return o;
 }