video: To remove duplicated lines, added e_video_hwc_client_mask_update(). 19/204519/1
authorSeunghun Lee <shiin.lee@samsung.com>
Fri, 19 Apr 2019 08:53:30 +0000 (17:53 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Wed, 24 Apr 2019 06:34:24 +0000 (15:34 +0900)
Change-Id: I29774158bdd990fda0d8df07cbc391356346e5e0

src/bin/video/iface/e_video_hwc.c
src/bin/video/iface/e_video_hwc.h
src/bin/video/iface/e_video_hwc_planes.c
src/bin/video/iface/e_video_hwc_windows.c

index 682af22181bf344fbff0acc646dfc32d2bcba762..2b7850c78cb00f6d388a548fae86b1b702a30cb3 100644 (file)
@@ -1721,3 +1721,46 @@ e_video_hwc_wait_buffer_commit(E_Video_Hwc *evh)
 {
    _e_video_hwc_wait_buffer_commit(evh);
 }
+
+EINTERN void
+e_video_hwc_client_mask_update(E_Video_Hwc *evh)
+{
+   E_Client *topmost;
+
+   topmost = e_comp_wl_topmost_parent_get(evh->ec);
+   if (topmost && topmost->argb && !e_comp_object_mask_has(evh->ec->frame))
+     {
+        Eina_Bool do_punch = EINA_TRUE;
+
+        /* FIXME: the mask obj can be drawn at the wrong position in the beginnig
+         * time. It happens caused by window manager policy.
+         */
+        if ((topmost->fullscreen || topmost->maximized) &&
+            (evh->geo.output_r.x == 0 || evh->geo.output_r.y == 0))
+          {
+             int bw, bh;
+
+             e_pixmap_size_get(topmost->pixmap, &bw, &bh);
+
+             if (bw > 100 && bh > 100 &&
+                 evh->geo.output_r.w < 100 && evh->geo.output_r.h < 100)
+               {
+                  VIN("don't punch. (%dx%d, %dx%d)", evh->ec,
+                      bw, bh, evh->geo.output_r.w, evh->geo.output_r.h);
+                  do_punch = EINA_FALSE;
+               }
+          }
+
+        if (do_punch)
+          {
+             e_comp_object_mask_set(evh->ec->frame, EINA_TRUE);
+             VIN("punched", evh->ec);
+          }
+     }
+
+   if (e_video_debug_punch_value_get())
+     {
+        e_comp_object_mask_set(evh->ec->frame, EINA_TRUE);
+        VIN("punched", evh->ec);
+     }
+}
index 1024db71b25e74939aef531cfbb98c01fd599320..a2a38ddf07f24aa6ec5f4154c4443141ce1227e6 100644 (file)
@@ -95,6 +95,7 @@ EINTERN tbm_surface_h   e_video_hwc_windows_displaying_buffer_get(E_Video_Hwc *e
 
 EINTERN void         e_video_hwc_show(E_Video_Hwc *evh);
 EINTERN void         e_video_hwc_wait_buffer_commit(E_Video_Hwc *evh);
+EINTERN void         e_video_hwc_client_mask_update(E_Video_Hwc *evh);
 EINTERN Eina_Bool    e_video_hwc_current_fb_update(E_Video_Hwc *evh);
 
 EINTERN E_Client    *e_video_hwc_client_offscreen_parent_get(E_Client *ec);
index c634b70c30860691aaac89e5b6f2f52f52b41e66..cba1993696bf98a75ffcbf70fd38b7d9f039b556 100644 (file)
@@ -334,7 +334,6 @@ _e_video_hwc_planes_buffer_commit(E_Video_Hwc_Planes *evhp, E_Comp_Wl_Video_Buf
 {
    E_Client_Video_Info info, old_info;
    tdm_error ret;
-   E_Client *topmost;
 
    if (!vbuf)
      {
@@ -396,42 +395,7 @@ _e_video_hwc_planes_buffer_commit(E_Video_Hwc_Planes *evhp, E_Comp_Wl_Video_Buf
 
    _tdm_layer_property_list_set(evhp->tdm.layer, evhp->tdm.late_prop_list);
 
-   topmost = e_comp_wl_topmost_parent_get(evhp->base.ec);
-   if (topmost && topmost->argb && !e_comp_object_mask_has(evhp->base.ec->frame))
-     {
-        Eina_Bool do_punch = EINA_TRUE;
-
-        /* FIXME: the mask obj can be drawn at the wrong position in the beginnig
-         * time. It happens caused by window manager policy.
-         */
-        if ((topmost->fullscreen || topmost->maximized) &&
-            (evhp->base.geo.output_r.x == 0 || evhp->base.geo.output_r.y == 0))
-          {
-             int bw, bh;
-
-             e_pixmap_size_get(topmost->pixmap, &bw, &bh);
-
-             if (bw > 100 && bh > 100 &&
-                 evhp->base.geo.output_r.w < 100 && evhp->base.geo.output_r.h < 100)
-               {
-                  VIN("don't punch. (%dx%d, %dx%d)", evhp->base.ec,
-                      bw, bh, evhp->base.geo.output_r.w, evhp->base.geo.output_r.h);
-                  do_punch = EINA_FALSE;
-               }
-          }
-
-        if (do_punch)
-          {
-             e_comp_object_mask_set(evhp->base.ec->frame, EINA_TRUE);
-             VIN("punched", evhp->base.ec);
-          }
-     }
-
-   if (e_video_debug_punch_value_get())
-     {
-        e_comp_object_mask_set(evhp->base.ec->frame, EINA_TRUE);
-        VIN("punched", evhp->base.ec);
-     }
+   e_video_hwc_client_mask_update((E_Video_Hwc *)evhp);
 
    DBG("Client(%s):PID(%d) RscID(%d), Buffer(%p, refcnt:%d) is shown."
        "Geometry details are : buffer size(%dx%d) src(%d,%d, %dx%d)"
index 1088f5eab5cfd66eed451eac76f813942d17402b..9ecc0b0da7fe8951e5d9c59abded39a04859e13d 100644 (file)
@@ -86,44 +86,7 @@ _e_video_frame_buffer_show(E_Video_Hwc_Windows *evhw, E_Comp_Wl_Video_Buf *vbuf)
 
    // TODO:: this logic move to the hwc windows after hwc commit
 #if 1
-   E_Client *topmost;
-
-   topmost = e_comp_wl_topmost_parent_get(evhw->base.ec);
-   if (topmost && topmost->argb && !e_comp_object_mask_has(evhw->base.ec->frame))
-     {
-        Eina_Bool do_punch = EINA_TRUE;
-
-        /* FIXME: the mask obj can be drawn at the wrong position in the beginnig
-         * time. It happens caused by window manager policy.
-         */
-        if ((topmost->fullscreen || topmost->maximized) &&
-            (evhw->base.geo.output_r.x == 0 || evhw->base.geo.output_r.y == 0))
-          {
-             int bw, bh;
-
-             e_pixmap_size_get(topmost->pixmap, &bw, &bh);
-
-             if (bw > 100 && bh > 100 &&
-                 evhw->base.geo.output_r.w < 100 && evhw->base.geo.output_r.h < 100)
-               {
-                  VIN("don't punch. (%dx%d, %dx%d)", evhw->base.ec,
-                      bw, bh, evhw->base.geo.output_r.w, evhw->base.geo.output_r.h);
-                  do_punch = EINA_FALSE;
-               }
-          }
-
-        if (do_punch)
-          {
-             e_comp_object_mask_set(evhw->base.ec->frame, EINA_TRUE);
-             VIN("punched", evhw->base.ec);
-          }
-     }
-
-   if (e_video_debug_punch_value_get())
-     {
-        e_comp_object_mask_set(evhw->base.ec->frame, EINA_TRUE);
-        VIN("punched", evhw->base.ec);
-     }
+   e_video_hwc_client_mask_update((E_Video_Hwc *)evhw);
 #endif
 
    return EINA_TRUE;