ivi-shell: remove is_surface_in_layer API

This internal API is redundant, because a surface is allowed to be only
on one layer.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
dev
Ucan, Emre (ADITG/SW1) 9 years ago committed by Pekka Paalanen
parent bb4ec0a186
commit 4a18364595
  1. 23
      ivi-shell/ivi-layout.c

@ -232,25 +232,6 @@ ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf)
free(ivisurf); free(ivisurf);
} }
/**
* Internal API to check ivi_layer/ivi_surface already added in ivi_layer/ivi_screen.
* Called by ivi_layout_layer_add_surface/ivi_layout_screenAddLayer
*/
static int
is_surface_in_layer(struct ivi_layout_surface *ivisurf,
struct ivi_layout_layer *ivilayer)
{
struct ivi_layout_surface *surf = NULL;
wl_list_for_each(surf, &ivilayer->pending.surface_list, pending.link) {
if (surf->id_surface == ivisurf->id_surface) {
return 1;
}
}
return 0;
}
/** /**
* Internal API to initialize ivi_screens found from output_list of weston_compositor. * Internal API to initialize ivi_screens found from output_list of weston_compositor.
* Called by ivi_layout_init_with_compositor. * Called by ivi_layout_init_with_compositor.
@ -2387,15 +2368,13 @@ ivi_layout_layer_add_surface(struct ivi_layout_layer *ivilayer,
struct ivi_layout *layout = get_instance(); struct ivi_layout *layout = get_instance();
struct ivi_layout_surface *ivisurf = NULL; struct ivi_layout_surface *ivisurf = NULL;
struct ivi_layout_surface *next = NULL; struct ivi_layout_surface *next = NULL;
int is_surf_in_layer = 0;
if (ivilayer == NULL || addsurf == NULL) { if (ivilayer == NULL || addsurf == NULL) {
weston_log("ivi_layout_layer_add_surface: invalid argument\n"); weston_log("ivi_layout_layer_add_surface: invalid argument\n");
return IVI_FAILED; return IVI_FAILED;
} }
is_surf_in_layer = is_surface_in_layer(addsurf, ivilayer); if (addsurf->on_layer == ivilayer) {
if (is_surf_in_layer == 1) {
weston_log("ivi_layout_layer_add_surface: addsurf is already available\n"); weston_log("ivi_layout_layer_add_surface: addsurf is already available\n");
return IVI_SUCCEEDED; return IVI_SUCCEEDED;
} }

Loading…
Cancel
Save