* 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))
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))
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