diff options
author | Ucan, Emre (ADITG/SW1) <eucan@de.adit-jv.com> | 2016-03-16 13:37:07 +0000 |
---|---|---|
committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2016-03-17 13:32:05 +0200 |
commit | f46306f0593eb51afbe1ba1edf3939eea58dcfbb (patch) | |
tree | e4eb036fc9e0b6413e8d0dcc2d12f9438ebcc781 | |
parent | 72ad164b5dba6fb295c7eff7440805aad01bd120 (diff) |
ivi-shell: simplify ivi_layout_screen_add_layer
It is not necessary check the ivi-id of pregiven objects (layer or
surface). Traversing the list of all objects is sure to find the exact
same pointer we start with, bugs aside.
The controller modules are responsible for providing valid pointers. We
cannot protect from invalid pointers anyway.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: commit message]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-rw-r--r-- | ivi-shell/ivi-layout.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 5f25e100..de510a85 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -2014,10 +2014,6 @@ static int32_t ivi_layout_screen_add_layer(struct ivi_layout_screen *iviscrn, struct ivi_layout_layer *addlayer) { - struct ivi_layout *layout = get_instance(); - struct ivi_layout_layer *ivilayer = NULL; - struct ivi_layout_layer *next = NULL; - if (iviscrn == NULL || addlayer == NULL) { weston_log("ivi_layout_screen_add_layer: invalid argument\n"); return IVI_FAILED; @@ -2028,14 +2024,8 @@ ivi_layout_screen_add_layer(struct ivi_layout_screen *iviscrn, return IVI_SUCCEEDED; } - wl_list_for_each_safe(ivilayer, next, &layout->layer_list, link) { - if (ivilayer->id_layer == addlayer->id_layer) { - wl_list_remove(&ivilayer->pending.link); - wl_list_insert(&iviscrn->pending.layer_list, - &ivilayer->pending.link); - break; - } - } + wl_list_remove(&addlayer->pending.link); + wl_list_insert(&iviscrn->pending.layer_list, &addlayer->pending.link); iviscrn->order.dirty = 1; |