From: Nobuhiko Tanibata Date: Mon, 27 Apr 2015 07:57:26 +0000 (+0900) Subject: ivi-shell: remove unnecesary assignment of fail safe value. X-Git-Tag: 1.7.91~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bcff632727f9d65e4aa1daa724b8097db8321d1c;p=platform%2Fupstream%2Fweston.git ivi-shell: remove unnecesary assignment of fail safe value. Scale is calculated as float and to be inf. It shall be avoided by, ivi_layout_surface_set_source/destination_rectangle. So output log and then return this method to use prevous scale for fail safe. Signed-off-by: Nobuhiko Tanibata Acked-by: Pekka Paalanen --- diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 95d09087..e70b853b 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -719,9 +719,14 @@ update_scale(struct ivi_layout_layer *ivilayer, return; } - if (ivisurf->prop.dest_width == 0 && ivisurf->prop.dest_height == 0) { - ivisurf->prop.dest_width = ivisurf->surface->width_from_buffer; - ivisurf->prop.dest_height = ivisurf->surface->height_from_buffer; + if (ivisurf->prop.source_width == 0 || ivisurf->prop.source_height == 0) { + weston_log("ivi-shell: source rectangle is not yet set by ivi_layout_surface_set_source_rectangle\n"); + return; + } + + if (ivisurf->prop.dest_width == 0 || ivisurf->prop.dest_height == 0) { + weston_log("ivi-shell: destination rectangle is not yet set by ivi_layout_surface_set_destination_rectangle\n"); + return; } lw = ((float)ivilayer->prop.dest_width / (float)ivilayer->prop.source_width );