From: Seunghun Lee Date: Thu, 12 Nov 2020 00:52:34 +0000 (+0900) Subject: viewport: Raise errors when bad src or dst values are used. X-Git-Tag: submit/tizen/20201120.053428~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5c19445572354237a3eb6aa39f12fe526b689787;p=platform%2Fupstream%2Fenlightenment.git viewport: Raise errors when bad src or dst values are used. The detail error cases are described at 'scaler.xml' in wayland-extension project. Change-Id: Idff11a08ed8c0f4d2f95909fda6230b623e208d1 --- diff --git a/src/bin/e_comp_wl_viewport.c b/src/bin/e_comp_wl_viewport.c index c2d110f5c0..36f96a9217 100644 --- a/src/bin/e_comp_wl_viewport.c +++ b/src/bin/e_comp_wl_viewport.c @@ -1942,12 +1942,23 @@ _e_viewport_cb_set(struct wl_client *client EINA_UNUSED, { ERR("source dimensions must be non-negative (%fx%f)", wl_fixed_to_double(src_width), wl_fixed_to_double(src_height)); + wl_resource_post_error(resource, + WL_VIEWPORT_ERROR_BAD_VALUE, + "wl_surface@%d viewport source " + "w=%f < 0 or h=%f < 0", + wl_resource_get_id(ec->comp_data->surface), + wl_fixed_to_double(src_width), + wl_fixed_to_double(src_height)); return; } if (dst_width <= 0 || dst_height <= 0) { ERR("destination dimensions must be positive (%dx%d)", dst_width, dst_height); + wl_resource_post_error(resource, + WL_VIEWPORT_ERROR_BAD_VALUE, + "destination size must be positive (%dx%d)", + dst_width, dst_height); return; } @@ -1987,6 +1998,13 @@ _e_viewport_cb_set_source(struct wl_client *client EINA_UNUSED, { ERR("source size must be positive (%fx%f)", wl_fixed_to_double(src_width), wl_fixed_to_double(src_height)); + wl_resource_post_error(resource, + WL_VIEWPORT_ERROR_BAD_VALUE, + "wl_surface@%d viewport source " + "w=%f <= 0 or h=%f <= 0", + wl_resource_get_id(ec->comp_data->surface), + wl_fixed_to_double(src_width), + wl_fixed_to_double(src_height)); return; } @@ -2021,6 +2039,10 @@ _e_viewport_cb_set_destination(struct wl_client *client EINA_UNUSED, if (dst_width <= 0 || dst_height <= 0) { ERR("destination size must be positive (%dx%d)", dst_width, dst_height); + wl_resource_post_error(resource, + WL_VIEWPORT_ERROR_BAD_VALUE, + "destination size must be positive (%dx%d)", + dst_width, dst_height); return; }