video: implementation tizen_policy.has_video 34/146234/2
authorBoram Park <boram1288.park@samsung.com>
Fri, 25 Aug 2017 10:13:30 +0000 (19:13 +0900)
committerBoram Park <boram1288.park@samsung.com>
Sun, 27 Aug 2017 23:17:51 +0000 (08:17 +0900)
Change-Id: Ia47e653135e33119978f746aa723cb46608db795

src/bin/e_comp_wl.c
src/bin/e_comp_wl.h
src/bin/e_policy_wl.c

index 86913085c93e40a4c874b6604b4dbb07e7d7e15c..527ae5ac236781fe0a95d9ee08c876677b2635b6 100644 (file)
@@ -293,6 +293,9 @@ e_comp_wl_video_subsurface_has(E_Client *ec)
    if (ec->comp_data->video_client)
      return EINA_TRUE;
 
+   if (ec->comp_data->has_video_client)
+     return EINA_TRUE;
+
    EINA_LIST_FOREACH(ec->comp_data->sub.below_list_pending, l, subc)
      if (e_comp_wl_video_subsurface_has(subc))
         return EINA_TRUE;
index 38d232e5d1ba791f9b97bcbfe21a1ce269b3e778..bbc9366faa92d1e40caf682fbe8d30e22a74e2b7 100644 (file)
@@ -471,6 +471,7 @@ struct _E_Comp_Wl_Client_Data
    Eina_Bool focus_update : 1;
    Eina_Bool opaque_state : 1;
    Eina_Bool video_client : 1;
+   Eina_Bool has_video_client : 1;
    Eina_Bool never_hwc : 1;          //  force window not to do hwc
    unsigned char accepts_focus : 1;
    unsigned char conformant : 1;
index f0e63553d6adb3e6fcc622aa9305e4d3769cb92c..f07b2006fc2130ddaa7a1272c9337f27fc049794 100644 (file)
@@ -3199,6 +3199,20 @@ _tzpol_iface_cb_destroy(struct wl_client *client, struct wl_resource *res_tzpol)
    wl_resource_destroy(res_tzpol);
 }
 
+static void
+_tzpol_iface_cb_has_video(struct wl_client *client, struct wl_resource *res_tzpol, struct wl_resource *surface, uint32_t has)
+{
+   E_Client *ec;
+
+   if (!(ec = wl_resource_get_user_data(surface))) return;
+   if (e_object_is_del(E_OBJECT(ec))) return;
+   if (ec->comp_data->has_video_client == has) return;
+
+   ELOGF("TZPOL", "video client has(%d)", ec->pixmap, ec, has);
+
+   ec->comp_data->has_video_client = has;
+}
+
 // --------------------------------------------------------
 // tizen_policy_interface
 // --------------------------------------------------------
@@ -3242,6 +3256,7 @@ static const struct tizen_policy_interface _tzpol_iface =
    _tzpol_iface_cb_parent_set,
    _tzpol_iface_cb_ack_conformant_region,
    _tzpol_iface_cb_destroy,
+   _tzpol_iface_cb_has_video,
 };
 
 static void
@@ -6846,7 +6861,7 @@ e_policy_wl_init(void)
    /* create globals */
    global = wl_global_create(e_comp_wl->wl.disp,
                              &tizen_policy_interface,
-                             6,
+                             7,
                              NULL,
                              _tzpol_cb_bind);
    EINA_SAFETY_ON_NULL_GOTO(global, err);