summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@samsung.com>2013-03-20 18:53:26 +0900
committerCedric BAIL <cedric.bail@samsung.com>2013-03-22 15:30:34 +0900
commitd1112534a1068728a4d69ac1d42865a4202f3c1e (patch)
treee52758f0140f9960b4b4b2657c5116bbab04d411
parentfba8124fc55b7b8322c08efec70042b730bbb17c (diff)
evas: optionally propagate update rectangle on RENDER_POST.
-rw-r--r--src/lib/evas/Evas.h6
-rw-r--r--src/lib/evas/canvas/evas_render.c17
2 files changed, 17 insertions, 6 deletions
diff --git a/src/lib/evas/Evas.h b/src/lib/evas/Evas.h
index b0f8eeca6d..fe8ee81648 100644
--- a/src/lib/evas/Evas.h
+++ b/src/lib/evas/Evas.h
@@ -824,6 +824,7 @@ typedef struct _Evas_Event_Multi_Move Evas_Event_Multi_Move; /**< Event struc
824typedef struct _Evas_Event_Key_Down Evas_Event_Key_Down; /**< Event structure for #EVAS_CALLBACK_KEY_DOWN event callbacks */ 824typedef struct _Evas_Event_Key_Down Evas_Event_Key_Down; /**< Event structure for #EVAS_CALLBACK_KEY_DOWN event callbacks */
825typedef struct _Evas_Event_Key_Up Evas_Event_Key_Up; /**< Event structure for #EVAS_CALLBACK_KEY_UP event callbacks */ 825typedef struct _Evas_Event_Key_Up Evas_Event_Key_Up; /**< Event structure for #EVAS_CALLBACK_KEY_UP event callbacks */
826typedef struct _Evas_Event_Hold Evas_Event_Hold; /**< Event structure for #EVAS_CALLBACK_HOLD event callbacks */ 826typedef struct _Evas_Event_Hold Evas_Event_Hold; /**< Event structure for #EVAS_CALLBACK_HOLD event callbacks */
827typedef struct _Evas_Event_Render_Post Evas_Event_Render_Post; /**< Event structure that may come with #EVAS_CALLBACK_RENDER_POST event callbacks @since 1.8 */
827 828
828typedef enum _Evas_Load_Error 829typedef enum _Evas_Load_Error
829{ 830{
@@ -1192,6 +1193,11 @@ struct _Evas_Event_Key_Up /** Key release event */
1192 Evas_Device *dev; 1193 Evas_Device *dev;
1193}; 1194};
1194 1195
1196struct _Evas_Event_Render_Post /** Send when the frame rendering is done @since 1.8 */
1197{
1198 Eina_List *updated_area; /**< A list of rectangle that were updated in the canvas */
1199};
1200
1195struct _Evas_Event_Hold /** Hold change event */ 1201struct _Evas_Event_Hold /** Hold change event */
1196{ 1202{
1197 int hold; /**< The hold flag */ 1203 int hold; /**< The hold flag */
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index e818459325..aa0576308c 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -1931,7 +1931,12 @@ evas_render_updates_internal(Evas *eo_e,
1931 evas_module_clean(); 1931 evas_module_clean();
1932 1932
1933 if (!do_async) 1933 if (!do_async)
1934 evas_event_callback_call(eo_e, EVAS_CALLBACK_RENDER_POST, NULL); 1934 {
1935 Evas_Event_Render_Post post;
1936
1937 post.updated_area = e->render.updates;
1938 evas_event_callback_call(eo_e, EVAS_CALLBACK_RENDER_POST, e->render.updates ? &post : NULL);
1939 }
1935 1940
1936 RD("---]\n"); 1941 RD("---]\n");
1937 1942
@@ -1960,6 +1965,7 @@ _drop_texts_ref(const void *container EINA_UNUSED, void *data, void *fdata EINA_
1960static void 1965static void
1961evas_render_wakeup(Evas *eo_e) 1966evas_render_wakeup(Evas *eo_e)
1962{ 1967{
1968 Evas_Event_Render_Post post;
1963 Render_Updates *ru; 1969 Render_Updates *ru;
1964 Eina_Bool haveup = EINA_FALSE; 1970 Eina_Bool haveup = EINA_FALSE;
1965 Eina_List *ret_updates = NULL; 1971 Eina_List *ret_updates = NULL;
@@ -1975,10 +1981,7 @@ evas_render_wakeup(Evas *eo_e)
1975 ru->area->x, ru->area->y, ru->area->w, ru->area->h, 1981 ru->area->x, ru->area->y, ru->area->w, ru->area->h,
1976 EVAS_RENDER_MODE_ASYNC_END); 1982 EVAS_RENDER_MODE_ASYNC_END);
1977 1983
1978 if (e->render.updates_cb) 1984 ret_updates = eina_list_append(ret_updates, ru->area);
1979 ret_updates = eina_list_append(ret_updates, ru->area);
1980 else
1981 eina_rectangle_free(ru->area);
1982 evas_cache_image_drop(ru->surface); 1985 evas_cache_image_drop(ru->surface);
1983 free(ru); 1986 free(ru);
1984 haveup = EINA_TRUE; 1987 haveup = EINA_TRUE;
@@ -2017,9 +2020,11 @@ evas_render_wakeup(Evas *eo_e)
2017 e->render.data = NULL; 2020 e->render.data = NULL;
2018 e->rendering = EINA_FALSE; 2021 e->rendering = EINA_FALSE;
2019 2022
2020 evas_event_callback_call(eo_e, EVAS_CALLBACK_RENDER_POST, NULL); 2023 post.updated_area = ret_updates;
2024 evas_event_callback_call(eo_e, EVAS_CALLBACK_RENDER_POST, &post);
2021 2025
2022 if (up_cb) up_cb(up_data, eo_e, ret_updates); 2026 if (up_cb) up_cb(up_data, eo_e, ret_updates);
2027 else evas_render_updates_free(ret_updates);
2023 2028
2024 eo_unref(eo_e); 2029 eo_unref(eo_e);
2025} 2030}