Set manual render mode while destroying instances.
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 9 Apr 2015 10:05:04 +0000 (19:05 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Thu, 9 Apr 2015 10:05:27 +0000 (19:05 +0900)
[model] Redwood,Kiran,B3(Wearable)
[binary_type] AP
[customer] Docomo/Orange/ATT/Open
[issue#] N/A
[problem]
[cause]
[solution]
[team] HomeTF
[request]
[horizontal_expansion]

Change-Id: Id6fdda560653dfe09f66fb418282b766eee14bfb

src/virtual_window.c

index f302cad..74d1b05 100644 (file)
@@ -32,6 +32,7 @@
 #include <widget_service_internal.h>
 #include <widget_conf.h>
 #include <widget_buffer.h>
+#include <widget_provider.h>
 
 #include "widget.h"
 #include "widget_internal.h"
@@ -861,6 +862,22 @@ static void post_render_cb(void *data, Evas *e, void *event_info)
        }
 }
 
+static void pre_destroy_cb(widget_pre_callback_e type, const char *pkgname, const char *id, void *data)
+{
+       vwin_info_t info = data;
+       if (strcmp(info->id, id)) {
+               /* Skip */
+               DbgPrint("SKIP: Pre destroy event callback is called [%s]\n", id);
+               return;
+       }
+       DbgPrint("Pre destroy event callback is called [%s]\n", id);
+
+       if (info->ee) {
+               DbgPrint("Toggle manual render mode to prevent from unwanted rendering");
+               ecore_evas_manual_render_set(info->ee, EINA_TRUE);
+       }
+}
+
 static void ecore_evas_free_cb(Ecore_Evas *ee)
 {
        vwin_info_t info;
@@ -871,6 +888,8 @@ static void ecore_evas_free_cb(Ecore_Evas *ee)
                return;
        }
 
+       widget_provider_del_pre_callback(WIDGET_PRE_DESTROY_CALLBACK, pre_destroy_cb, info);
+
        if (info->e) {
                evas_event_callback_del(info->e, EVAS_CALLBACK_RENDER_POST, post_render_cb);
                evas_event_callback_del(info->e, EVAS_CALLBACK_RENDER_PRE, pre_render_cb);
@@ -890,6 +909,12 @@ PUBLIC Evas *widget_get_evas(const char *id)
        Evas_Object *rect;
        const char *engine;
 
+       /**
+        * @TODO
+        * If the evas object is already created,
+        * this function should returns ERROR.
+        */
+
        if (!s_info.alloc_canvas && !s_info.alloc_canvas_with_stride && !s_info.alloc_canvas_with_pixmap) {
                s_info.alloc_canvas_with_pixmap = dlsym(RTLD_DEFAULT, "ecore_evas_gl_x11_pixmap_allocfunc_new");
                if (!s_info.alloc_canvas_with_pixmap) {
@@ -1008,6 +1033,8 @@ PUBLIC Evas *widget_get_evas(const char *id)
        evas_event_callback_add(info->e, EVAS_CALLBACK_RENDER_POST, post_render_cb, info);
        evas_event_callback_add(info->e, EVAS_CALLBACK_RENDER_PRE, pre_render_cb, info);
 
+       widget_provider_add_pre_callback(WIDGET_PRE_DESTROY_CALLBACK, pre_destroy_cb, info);
+
        return info->e;
 }