ivi-shell: simplify commit_changes function
It is a better idea to use one for loop instead of using three nested for loops. We do not need to update the transformation of views according to the scenegraph. The important thing is that every visible view is updated before commit_changes function returns. The first if statement checks, if the view is on the currently rendered scenegraph. The second if statement checks, if the view's layer or surface is visible. These checks ensure that we do not update the transformation matrix of a view, which is not visible on the screen. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> [Pekka: minor whitespace fix] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
committed by
Pekka Paalanen
parent
1b92ba20ac
commit
27799355a9
+12
-11
@@ -662,30 +662,31 @@ commit_changes(struct ivi_layout *layout)
|
|||||||
{
|
{
|
||||||
struct ivi_layout_screen *iviscrn = NULL;
|
struct ivi_layout_screen *iviscrn = NULL;
|
||||||
struct ivi_layout_layer *ivilayer = NULL;
|
struct ivi_layout_layer *ivilayer = NULL;
|
||||||
|
struct ivi_layout_surface *ivisurf = NULL;
|
||||||
struct ivi_layout_view *ivi_view = NULL;
|
struct ivi_layout_view *ivi_view = NULL;
|
||||||
|
|
||||||
wl_list_for_each(iviscrn, &layout->screen_list, link) {
|
wl_list_for_each(ivi_view, &layout->view_list, link) {
|
||||||
wl_list_for_each(ivilayer, &iviscrn->order.layer_list, order.link) {
|
ivisurf = ivi_view->ivisurf;
|
||||||
|
ivilayer = ivi_view->on_layer;
|
||||||
|
iviscrn = ivilayer->on_screen;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If ivilayer is invisible, weston_view of ivisurf doesn't
|
* If the view is not on the currently rendered scenegraph,
|
||||||
* need to be modified.
|
* we do not need to update its properties.
|
||||||
*/
|
*/
|
||||||
if (ivilayer->prop.visibility == false)
|
if (wl_list_empty(&ivi_view->order_link) || !iviscrn)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
wl_list_for_each(ivi_view, &ivilayer->order.view_list, order_link) {
|
|
||||||
/*
|
/*
|
||||||
* If ivilayer is invisible, weston_view of ivisurf doesn't
|
* If the view's layer or surface is invisible, we do not need
|
||||||
* need to be modified.
|
* to update its properties.
|
||||||
*/
|
*/
|
||||||
if (ivi_view->ivisurf->prop.visibility == false)
|
if (!ivilayer->prop.visibility || !ivisurf->prop.visibility)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
update_prop(ivi_view);
|
update_prop(ivi_view);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
commit_surface_list(struct ivi_layout *layout)
|
commit_surface_list(struct ivi_layout *layout)
|
||||||
|
|||||||
Reference in New Issue
Block a user