ivi-shell: remove unnecesary assignment of fail safe value.
authorNobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Mon, 27 Apr 2015 07:57:26 +0000 (16:57 +0900)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Tue, 28 Apr 2015 09:59:18 +0000 (12:59 +0300)
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 <nobuhiko_tanibata@xddp.denso.co.jp>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
ivi-shell/ivi-layout.c

index 95d090875f1ce8bfb9b1d0a84b5436818eeecd6c..e70b853b98ea18b0df781c7ab96a13e75aa18211 100644 (file)
@@ -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 );