video: Removed code lines reducing size for input/output in case it's bigger than... 87/215187/2 accepted/tizen/unified/20191008.101637 submit/tizen/20191002.100931
authorSeunghun Lee <shiin.lee@samsung.com>
Wed, 2 Oct 2019 08:23:19 +0000 (17:23 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Wed, 2 Oct 2019 10:07:59 +0000 (19:07 +0900)
There was a bug that a geometry for input couldn't be recalculated
even though geometry for output had gotten smaller than screen size.

Removed this logic because no reason to do this, and it only hides the problem.

Change-Id: I2b76698c29824fb08be20a631f834bdd99c54e9b

src/bin/video/iface/e_video_hwc.c

index dcb25f5e2ebb43cd678cf062b34c268ba09aadf6..2fb2471aa6cdf63b42785980e3e295f549495b4b 100644 (file)
@@ -1155,86 +1155,10 @@ _e_video_hwc_geometry_viewport_apply(E_Client *ec, E_Video_Hwc_Geometry *out)
    return EINA_TRUE;
 }
 
-static void
-_e_video_hwc_geometry_cal_to_input(int output_w, int output_h, int input_w, int input_h,
-                                   uint32_t trasnform, int ox, int oy, int *ix, int *iy)
-{
-   float ratio_w, ratio_h;
-
-   switch(trasnform)
-     {
-      case WL_OUTPUT_TRANSFORM_NORMAL:
-      default:
-         *ix = ox, *iy = oy;
-         break;
-      case WL_OUTPUT_TRANSFORM_270:
-         *ix = oy, *iy = output_w - ox;
-         break;
-      case WL_OUTPUT_TRANSFORM_180:
-         *ix = output_w - ox, *iy = output_h - oy;
-         break;
-      case WL_OUTPUT_TRANSFORM_90:
-         *ix = output_h - oy, *iy = ox;
-         break;
-      case WL_OUTPUT_TRANSFORM_FLIPPED:
-         *ix = output_w - ox, *iy = oy;
-         break;
-      case WL_OUTPUT_TRANSFORM_FLIPPED_270:
-         *ix = oy, *iy = ox;
-         break;
-      case WL_OUTPUT_TRANSFORM_FLIPPED_180:
-         *ix = ox, *iy = output_h - oy;
-         break;
-      case WL_OUTPUT_TRANSFORM_FLIPPED_90:
-         *ix = output_h - oy, *iy = output_w - ox;
-         break;
-     }
-   if (trasnform & 0x1)
-     {
-        ratio_w = (float)input_w / output_h;
-        ratio_h = (float)input_h / output_w;
-     }
-   else
-     {
-        ratio_w = (float)input_w / output_w;
-        ratio_h = (float)input_h / output_h;
-     }
-   *ix *= ratio_w;
-   *iy *= ratio_h;
-}
-
-static void
-_e_video_hwc_geometry_cal_to_input_rect(E_Video_Hwc_Geometry *geo, Eina_Rectangle *srect, Eina_Rectangle *drect)
-{
-   int xf1, yf1, xf2, yf2;
-
-   /* first transform box coordinates if the scaler is set */
-
-   xf1 = srect->x;
-   yf1 = srect->y;
-   xf2 = srect->x + srect->w;
-   yf2 = srect->y + srect->h;
-
-   _e_video_hwc_geometry_cal_to_input(geo->output_r.w, geo->output_r.h,
-                                      geo->input_r.w, geo->input_r.h,
-                                      geo->transform, xf1, yf1, &xf1, &yf1);
-   _e_video_hwc_geometry_cal_to_input(geo->output_r.w, geo->output_r.h,
-                                      geo->input_r.w, geo->input_r.h,
-                                      geo->transform, xf2, yf2, &xf2, &yf2);
-
-   drect->x = MIN(xf1, xf2);
-   drect->y = MIN(yf1, yf2);
-   drect->w = MAX(xf1, xf2) - drect->x;
-   drect->h = MAX(yf1, yf2) - drect->y;
-}
-
 static Eina_Bool
 _e_video_hwc_geometry_get(E_Client *ec, E_Video_Hwc_Geometry *out)
 {
-   E_Zone *zone;
-   E_Client *topmost;
-   Eina_Rectangle screen = {0,};
-   Eina_Rectangle output_r = {0,}, input_r = {0,};
+   Eina_Rectangle input_r = {0,};
 
    /* get geometry information with buffer scale, transform and viewport. */
    if (!_e_video_hwc_geometry_viewport_apply(ec, out))
@@ -1242,15 +1166,6 @@ _e_video_hwc_geometry_get(E_Client *ec, E_Video_Hwc_Geometry *out)
 
    _e_video_hwc_geometry_map_apply(ec, out);
 
-   topmost = e_comp_wl_topmost_parent_get(ec);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(topmost, EINA_FALSE);
-
-   zone = e_comp_zone_xy_get(topmost->x, topmost->y);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(zone, EINA_FALSE);
-
-   screen.w = zone->w;
-   screen.h = zone->h;
-
    e_comp_wl_video_buffer_size_get(ec, &input_r.w, &input_r.h);
    // when topmost is not mapped, input size can be abnormal.
    // in this case, it will be render by topmost showing.
@@ -1260,56 +1175,6 @@ _e_video_hwc_geometry_get(E_Client *ec, E_Video_Hwc_Geometry *out)
         return EINA_FALSE;
      }
 
-   if (out->output_r.x >= 0 && out->output_r.y >= 0 &&
-       (out->output_r.x + out->output_r.w) <= screen.w &&
-       (out->output_r.y + out->output_r.h) <= screen.h)
-     return EINA_TRUE;
-
-   /* TODO: need to improve */
-
-   output_r = out->output_r;
-   if (!eina_rectangle_intersection(&output_r, &screen))
-     {
-        VER("output_r(%d,%d %dx%d) screen(%d,%d %dx%d) => intersect(%d,%d %dx%d)",
-            ec, EINA_RECTANGLE_ARGS(&out->output_r),
-            EINA_RECTANGLE_ARGS(&screen), EINA_RECTANGLE_ARGS(&output_r));
-        return EINA_TRUE;
-     }
-
-   output_r.x -= out->output_r.x;
-   output_r.y -= out->output_r.y;
-
-   if (output_r.w <= 0 || output_r.h <= 0)
-     {
-        VER("output area is empty", ec);
-        return EINA_FALSE;
-     }
-
-   VDB("output(%d,%d %dx%d) input(%d,%d %dx%d)",
-       ec, EINA_RECTANGLE_ARGS(&output_r), EINA_RECTANGLE_ARGS(&input_r));
-
-   _e_video_hwc_geometry_cal_to_input_rect(out, &output_r, &input_r);
-
-   VDB("output(%d,%d %dx%d) input(%d,%d %dx%d)",
-       ec, EINA_RECTANGLE_ARGS(&output_r), EINA_RECTANGLE_ARGS(&input_r));
-
-   output_r.x += out->output_r.x;
-   output_r.y += out->output_r.y;
-
-   input_r.x += out->input_r.x;
-   input_r.y += out->input_r.y;
-
-   output_r.x = output_r.x & ~1;
-   output_r.w = (output_r.w + 1) & ~1;
-
-   input_r.x = input_r.x & ~1;
-   input_r.w = (input_r.w + 1) & ~1;
-
-   out->output_r = output_r;
-   out->input_r = input_r;
-
-   _e_video_hwc_geometry_tdm_config_update(ec, out);
-
    return EINA_TRUE;
 }