video: For code readability of mask_update() function. 44/207744/2
authorSeunghun Lee <shiin.lee@samsung.com>
Tue, 14 May 2019 05:49:41 +0000 (14:49 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Wed, 12 Jun 2019 07:23:28 +0000 (07:23 +0000)
Change-Id: I370d30b9abddd54eafe1d998b57eb881851a605b

src/bin/video/iface/e_video_hwc.c

index e390b8b813671adbb44e96b447bd4ee90014e642..f9df1ecb142b209fca580603db5ce6759847990d 100644 (file)
@@ -1635,16 +1635,17 @@ EINTERN void
 e_video_hwc_client_mask_update(E_Video_Hwc *evh)
 {
    E_Client *topmost;
+   Eina_Bool punch = EINA_FALSE;
    int bw, bh;
 
    if (e_video_debug_punch_value_get())
      {
-        e_comp_object_mask_set(evh->ec->frame, EINA_TRUE);
-        VIN("punched", evh->ec);
+        punch = EINA_TRUE;
+        goto end;
      }
 
    topmost = e_comp_wl_topmost_parent_get(evh->ec);
-   if (topmost && topmost->argb && !e_comp_object_mask_has(evh->ec->frame))
+   if (topmost && topmost->argb)
      {
         /* FIXME: the mask obj can be drawn at the wrong position in the beginnig
          * time. It happens caused by window manager policy.
@@ -1662,7 +1663,25 @@ e_video_hwc_client_mask_update(E_Video_Hwc *evh)
                   return;
                }
           }
-        e_comp_object_mask_set(evh->ec->frame, EINA_TRUE);
-        VIN("punched", evh->ec);
+
+        punch = EINA_TRUE;
+     }
+
+end:
+   if (punch)
+     {
+        if (!e_comp_object_mask_has(evh->ec->frame))
+          {
+             e_comp_object_mask_set(evh->ec->frame, EINA_TRUE);
+             VIN("punched", evh->ec);
+          }
+     }
+   else
+     {
+        if (e_comp_object_mask_has(evh->ec->frame))
+          {
+             e_comp_object_mask_set(evh->ec->frame, EINA_FALSE);
+             VIN("Un-punched", evh->ec);
+          }
      }
 }