e_comp_wl: create a below-bg-rectangle if topmost has normal subsurfaces 80/88980/4 accepted/tizen/common/20160926.154353 accepted/tizen/ivi/20160927.081046 accepted/tizen/mobile/20160927.082720 accepted/tizen/tv/20160927.083532 accepted/tizen/wearable/20160927.081851 submit/tizen/20160926.083253
authorBoram Park <boram1288.park@samsung.com>
Wed, 21 Sep 2016 08:58:33 +0000 (17:58 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 26 Sep 2016 08:41:57 +0000 (17:41 +0900)
if topmost has a normal(has UI) subsurface, we have to need to create a
below-bg-rectangle always and a mask object for a e-comp-object to punch it.
And also, we better check if topmost has a normal subsurface than a video
subsurface for HWC.

Change-Id: I580a378cd9bfc58aae8d814b28165dda96de1b48

src/bin/e_client.c
src/bin/e_client.h
src/bin/e_comp.c
src/bin/e_comp_wl.c
src/bin/e_comp_wl.h

index 1bd73c894dfe992b075147cfb570de8537fc6707..04d16da572e63a8d98291d594d7f876338731db1 100644 (file)
@@ -6075,6 +6075,18 @@ e_client_mouse_move_send(E_Client *ec, int x, int y, Ecore_Device *dev, unsigned
    return res;
 }
 
+E_API Eina_Bool
+e_client_video_client_has(E_Client *ec)
+{
+   return e_comp_wl_video_subsurface_has(ec);
+}
+
+E_API Eina_Bool
+e_client_normal_client_has(E_Client *ec)
+{
+   return e_comp_wl_normal_subsurface_has(ec);
+}
+
 /* TODO: should be removed */
 E_API void
 e_remember_del(void *rem)
index 25b299f849ea27f3d0969f2d397eef33c2aef6dd..2bd8b2e047171f104c61f950082e9513b70bad1e 100644 (file)
@@ -1033,6 +1033,9 @@ E_API Eina_Bool e_client_touch_cancel_send(E_Client *ec);
 E_API Eina_Bool e_client_mouse_button_send(E_Client *ec, int buttons, Eina_Bool pressed, Ecore_Device *dev, unsigned int time);
 E_API Eina_Bool e_client_mouse_move_send(E_Client *ec, int x, int y, Ecore_Device *dev, unsigned int time);
 
+E_API Eina_Bool e_client_video_client_has(E_Client *ec);
+E_API Eina_Bool e_client_normal_client_has(E_Client *ec);
+
 E_API void e_remember_del(void *rem); /* TODO: should be removed */
 
 /**
index 0b72ed9fce090550647a526708640c6a5bd63205..08e2d1af60a01d333cfcd39ab438b6a05be1fba3 100644 (file)
@@ -505,12 +505,9 @@ _e_comp_hwc_prepare(void)
              if (e_comp_object_content_type_get(ec->frame) != E_COMP_OBJECT_CONTENT_TYPE_INT_IMAGE)
                 goto nextzone;
 
-             // if there is UI or video stream on subfrace, it means need to composite
-             if (cdata && (cdata->sub.below_list || cdata->sub.below_list_pending))
-               {
-                  if (!e_comp_wl_video_client_has(ec))
-                     goto nextzone;
-               }
+             // if there is UI subfrace, it means need to composite
+             if (e_client_normal_client_has(ec))
+                goto nextzone;
 
              // if ec has invalid buffer or scaled( transformed ) or forced composite(never_hwc)
              if ((!cdata) ||
index af869816f9e27ab501158bc52d38f8f4a7a369f0..8a91153b5130447d280793af1924bd4182578c75 100644 (file)
@@ -344,24 +344,51 @@ _e_comp_wl_topmost_parent_get(E_Client *ec)
    return ec;
 }
 
-E_API Eina_Bool
-e_comp_wl_video_client_has(E_Client *ec)
+EINTERN Eina_Bool
+e_comp_wl_video_subsurface_has(E_Client *ec)
 {
    E_Client *subc;
    Eina_List *l;
 
    if (!ec) return EINA_FALSE;
+   if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE;
    if (!ec->comp_data) return EINA_FALSE;
 
    if (ec->comp_data->video_client)
      return EINA_TRUE;
 
    EINA_LIST_FOREACH(ec->comp_data->sub.below_list_pending, l, subc)
-     if (e_comp_wl_video_client_has(subc))
+     if (e_comp_wl_video_subsurface_has(subc))
         return EINA_TRUE;
 
    EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc)
-     if (e_comp_wl_video_client_has(subc))
+     if (e_comp_wl_video_subsurface_has(subc))
+        return EINA_TRUE;
+
+   return EINA_FALSE;
+}
+
+EINTERN Eina_Bool
+e_comp_wl_normal_subsurface_has(E_Client *ec)
+{
+   E_Client *subc;
+   Eina_List *l;
+
+   if (!ec) return EINA_FALSE;
+   if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE;
+   if (!ec->comp_data) return EINA_FALSE;
+
+   /* if a leaf client is not video cliet */
+   if (ec->comp_data->sub.data && !ec->comp_data->sub.below_list &&
+       !ec->comp_data->sub.below_list_pending && !ec->comp_data->video_client)
+     return EINA_TRUE;
+
+   EINA_LIST_FOREACH(ec->comp_data->sub.below_list_pending, l, subc)
+     if (e_comp_wl_normal_subsurface_has(subc))
+        return EINA_TRUE;
+
+   EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc)
+     if (e_comp_wl_normal_subsurface_has(subc))
         return EINA_TRUE;
 
    return EINA_FALSE;
@@ -3274,10 +3301,34 @@ _e_comp_wl_subsurface_bg_evas_cb_resize(void *data, Evas *evas EINA_UNUSED, Evas
       evas_object_resize(ec->comp_data->sub.below_obj, ec->w, ec->h);
 }
 
+static void
+_e_comp_wl_subsurface_mask_set(E_Client *ec)
+{
+   E_Client *subc;
+   Eina_List *l;
+
+   if (!ec) return;
+   if (e_object_is_del(E_OBJECT(ec))) return;
+   if (!ec->comp_data) return;
+
+   /* if a leaf client is not video cliet */
+   if (!ec->comp_data->sub.below_list && !ec->comp_data->sub.below_list_pending && ec->comp_data->video_client)
+     if (ec->comp_data->video_client && !e_comp_object_mask_has(ec->frame))
+       {
+          e_comp_object_mask_set(ec->frame, EINA_TRUE);
+          return;
+       }
+
+   EINA_LIST_FOREACH(ec->comp_data->sub.below_list_pending, l, subc)
+     _e_comp_wl_subsurface_mask_set(subc);
+
+   EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc)
+     _e_comp_wl_subsurface_mask_set(subc);
+}
+
 static void
 _e_comp_wl_subsurface_check_below_bg_rectangle(E_Client *ec)
 {
-   Eina_Bool has_video_client;
    short layer;
 
    if (!ec || e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return;
@@ -3293,11 +3344,9 @@ _e_comp_wl_subsurface_check_below_bg_rectangle(E_Client *ec)
      }
    if (!ec->comp_data->sub.below_list && !ec->comp_data->sub.below_list_pending) return;
    if (ec->argb) return;
+   if (!e_comp_wl_normal_subsurface_has(ec)) return;
 
-   has_video_client = e_comp_wl_video_client_has(ec);
-   if (has_video_client) return;
-
-   ELOGF("COMP", "         |bg_rectangle|video_client:%d", NULL, ec, has_video_client);
+   ELOGF("COMP", "         |bg_rectangle", NULL, ec);
 
    /* create a bg rectangle if topmost window is 24 depth window */
    ec->comp_data->sub.below_obj = evas_object_rectangle_add(e_comp->evas);
@@ -3322,6 +3371,8 @@ _e_comp_wl_subsurface_check_below_bg_rectangle(E_Client *ec)
 
    if (evas_object_visible_get(ec->frame))
      evas_object_show(ec->comp_data->sub.below_obj);
+
+   _e_comp_wl_subsurface_mask_set(ec);
 }
 
 static void
index 7a5bdf8c35cfc9330820d95a7b36f89735d2ce0c..d2af2471c19cbb9c9caf8350a019702901356fa9 100644 (file)
@@ -521,7 +521,9 @@ E_API void e_comp_wl_hook_del(E_Comp_Wl_Hook *ch);
 
 E_API void e_comp_wl_shell_surface_ready(E_Client *ec);
 
-E_API Eina_Bool e_comp_wl_video_client_has(E_Client *ec);
+EINTERN Eina_Bool e_comp_wl_video_subsurface_has(E_Client *ec);
+EINTERN Eina_Bool e_comp_wl_normal_subsurface_has(E_Client *ec);
+
 E_API void e_comp_wl_map_size_cal_from_buffer(E_Client *ec);
 E_API void e_comp_wl_map_size_cal_from_viewport(E_Client *ec);
 E_API void e_comp_wl_map_apply(E_Client *ec);