video: enhanced readability 89/228689/2
authorSeunghun Lee <shiin.lee@samsung.com>
Thu, 12 Mar 2020 01:51:36 +0000 (10:51 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 26 Mar 2020 03:44:42 +0000 (03:44 +0000)
Change-Id: I8e2681161b31cba06de3f2fd06977e610928d344

src/bin/video/iface/e_video_hwc.c

index a9e8965e2bb09d6947eaad9debb1f3b967e90bdd..e8d26afab8bcdd18d84c144ece5725627060eda7 100644 (file)
@@ -1008,12 +1008,24 @@ normal:
  *   1. The given coordinates are not represented by rectangle.
  *   2. All angles except for 0, 90, 180, 270.
  */
+#ifdef IS_PORTRAIT_RECT
+#undef IS_PORTRAIT_RECT
+#endif
+#define IS_PORTRAIT_RECT(p) \
+   ((p[0].y == p[1].y) && (p[1].x == p[2].x) && (p[2].y == p[3].y) && (p[3].x == p[0].x))
+
+#ifdef IS_LANDSCAPE_RECT
+#undef IS_LANDSCAPE_RECT
+#endif
+#define IS_LANDSCAPE_RECT(p) \
+   ((p[0].x == p[1].x) && (p[1].y == p[2].y) && (p[2].x == p[3].x) && (p[3].y == p[0].y))
+
 static Eina_Bool
 _e_video_hwc_coords_to_rectangle_convert(Evas_Point p[4], Eina_Rectangle *rect, uint *transform)
 {
    Eina_Bool ret = EINA_FALSE;
 
-   if ((p[0].y == p[1].y) && (p[1].x == p[2].x) && (p[2].y == p[3].y) && (p[3].x == p[0].x))
+   if (IS_PORTRAIT_RECT(p))
      {
         /* 0 or 180 */
         if ((p[0].x < p[2].x) && (p[0].y < p[2].y))
@@ -1029,7 +1041,7 @@ _e_video_hwc_coords_to_rectangle_convert(Evas_Point p[4], Eina_Rectangle *rect,
              ret = EINA_TRUE;
           }
      }
-   else if ((p[0].x == p[1].x) && (p[1].y == p[2].y) && (p[2].x == p[3].x) && (p[3].y == p[0].y))
+   else if (IS_LANDSCAPE_RECT(p))
      {
         /* 90 or 270 */
         if ((p[0].x > p[2].x) && (p[0].y < p[2].y))
@@ -1049,6 +1061,9 @@ _e_video_hwc_coords_to_rectangle_convert(Evas_Point p[4], Eina_Rectangle *rect,
    return ret;
 }
 
+#undef IS_PORTRAIT_RECT
+#undef IS_LANDSCAPE_RECT
+
 /**
  * Merge transform value of E_Comp_Wl_Buffer_Viewport with given transform.
  * @in   vp          A 'E_Comp_Wl_Buffer_Viewport' instance to be merged