viewport: Restore source area to entire area of buffer 78/248978/2 accepted/tizen/unified/20201207.123247 submit/tizen/20201206.010849
authorSeunghun Lee <shiin.lee@samsung.com>
Fri, 4 Dec 2020 03:22:00 +0000 (12:22 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Fri, 4 Dec 2020 03:41:26 +0000 (12:41 +0900)
Source area has to be restored to entire area of buffer when client
requests to unset source area by setting width and height to -1.0
according to what wl_scaler of wayland-extension specification spelled
out.

This patch fixes it to follow the specification.

Change-Id: I0cc48f74e9850a59fca99137d8b5c381ddf53259

src/bin/e_comp_wl.c

index bd84ce5..d760afa 100644 (file)
@@ -425,10 +425,12 @@ e_comp_wl_map_apply(E_Client *ec)
 
    e_comp_object_map_update(ec->frame);
 
-   vp = &ec->comp_data->scaler.buffer_viewport;
-   if (vp->buffer.src_width == wl_fixed_from_int(-1)) return;
-
    cdata = ec->comp_data;
+   vp = &cdata->scaler.buffer_viewport;
+   if ((vp->buffer.src_width == wl_fixed_from_int(-1)) &&
+       (!cdata->viewport_transform))
+     return;
+
    sdata = ec->comp_data->sub.data;
    if (sdata)
      {
@@ -479,10 +481,20 @@ e_comp_wl_map_apply(E_Client *ec)
                                  ec->comp_data->width_from_viewport,
                                  ec->comp_data->height_from_viewport);
 
-   x1 = wl_fixed_to_int(vp->buffer.src_x);
-   y1 = wl_fixed_to_int(vp->buffer.src_y);
-   x2 = wl_fixed_to_int(vp->buffer.src_x + vp->buffer.src_width);
-   y2 = wl_fixed_to_int(vp->buffer.src_y + vp->buffer.src_height);
+   if (vp->buffer.src_width == wl_fixed_from_int(-1))
+     {
+        x1 = 0;
+        y1 = 0;
+        x2 = cdata->width_from_buffer;
+        y2 = cdata->height_from_buffer;
+     }
+   else
+     {
+        x1 = wl_fixed_to_int(vp->buffer.src_x);
+        y1 = wl_fixed_to_int(vp->buffer.src_y);
+        x2 = wl_fixed_to_int(vp->buffer.src_x + vp->buffer.src_width);
+        y2 = wl_fixed_to_int(vp->buffer.src_y + vp->buffer.src_height);
+     }
 
    e_util_transform_texcoord_set(cdata->viewport_transform, 0, x1, y1);
    e_util_transform_texcoord_set(cdata->viewport_transform, 1, x2, y1);