e_comp_object: do not clear surface when buffer is destroied 79/100179/2
authorMinJeong Kim <minjjj.kim@samsung.com>
Wed, 16 Nov 2016 12:06:31 +0000 (21:06 +0900)
committerMinJeong Kim <minjjj.kim@samsung.com>
Tue, 29 Nov 2016 02:41:25 +0000 (18:41 -0800)
enlightenment has the right to deal with a buffer even if a client requested
wl_buffer@destroy. So the enlightenment doesn't need to clear surface or
to delete evas object for wl_buffer@destroy when the enlightenment wants to
continue to display the buffer, enlightenment can use the destroied buffer
until there are no task to need the destroied buffer.

Change-Id: I84845bbb4a828ac763142386e65361b4e599598d
Signed-off-by: MinJeong Kim <minjjj.kim@samsung.com>
src/bin/e_comp_object.c

index dad918703e667b9f4825e52b52db7eb898ff14ef..d102a83c94ae393d7167e6bf4e3ab1df92ce45dc 100644 (file)
@@ -2557,6 +2557,16 @@ _e_comp_smart_hide(Evas_Object *obj)
         TRACE_DS_END();
         return;
      }
+
+   /* unset native surface if current displaying buffer was destroied */
+   if (!cw->buffer_destroy_listener.notify)
+     {
+        Evas_Native_Surface *ns;
+        ns = evas_object_image_native_surface_get(cw->obj);
+        if ((ns) && (ns->type == EVAS_NATIVE_SURFACE_WL) && (ns->data.wl.legacy_buffer))
+          _e_comp_object_native_surface_set(cw, NULL, EINA_TRUE);
+     }
+
    if (!cw->ec->input_only)
      {
         edje_object_freeze(cw->effect_obj);
@@ -3961,15 +3971,13 @@ _e_comp_object_cb_buffer_destroy(struct wl_listener *listener, void *data EINA_U
      {
         if (!e_object_delay_del_ref_get(E_OBJECT(cw->ec)))
           return;
-
-        if ((cw->native) &&
-            ((cw->animating) || (cw->effect_running)))
-          e_comp_object_effect_set(cw->smart_obj, NULL);
-        _e_comp_object_clear(cw);
-        evas_object_del(cw->smart_obj);
      }
    else
-     _e_comp_object_native_surface_set(cw, NULL, EINA_TRUE);
+     {
+        /* if it's current displaying buffer, do not remove its content */
+        if (!evas_object_visible_get(cw->ec->frame))
+          _e_comp_object_native_surface_set(cw, NULL, EINA_TRUE);
+     }
 }
 
 static void