ivi-shell: remove struct link_screen
link_screen's sole purpose is to link a layer to multiple screens, if the layer should be shown in multiple screens. This can be only achieved, if surfaces of the layer have multiple weston_views dedicated to the different screens. Current implementation assumes in many places that a ivi_surface has only one weston_view. Therefore, a layer can be only shown on one screen. Although this (a layer on multiple screens) is a nice to have feature for ivi-shell, it is not very crucial. In any case, it is not an easy task to implement this feature, because it has lot of corner cases. I removed with this patch the link_screen data structure, because it does not have any purpose in current implementation. 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> [Pekka: Line-wrapped commit message.]
This commit is contained in:
parent
dcba1a10d3
commit
8a223673ad
@ -65,11 +65,11 @@ struct ivi_layout_surface {
|
|||||||
struct ivi_layout_layer {
|
struct ivi_layout_layer {
|
||||||
struct wl_list link;
|
struct wl_list link;
|
||||||
struct wl_signal property_changed;
|
struct wl_signal property_changed;
|
||||||
struct wl_list screen_list;
|
|
||||||
struct wl_list link_to_surface;
|
struct wl_list link_to_surface;
|
||||||
uint32_t id_layer;
|
uint32_t id_layer;
|
||||||
|
|
||||||
struct ivi_layout *layout;
|
struct ivi_layout *layout;
|
||||||
|
struct ivi_layout_screen *on_screen;
|
||||||
|
|
||||||
struct ivi_layout_layer_properties prop;
|
struct ivi_layout_layer_properties prop;
|
||||||
uint32_t event_mask;
|
uint32_t event_mask;
|
||||||
|
@ -75,12 +75,6 @@ struct link_layer {
|
|||||||
struct wl_list link_to_layer;
|
struct wl_list link_to_layer;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct link_screen {
|
|
||||||
struct ivi_layout_screen *iviscrn;
|
|
||||||
struct wl_list link;
|
|
||||||
struct wl_list link_to_screen;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct listener_layout_notification {
|
struct listener_layout_notification {
|
||||||
void *userdata;
|
void *userdata;
|
||||||
struct wl_listener listener;
|
struct wl_listener listener;
|
||||||
@ -90,7 +84,6 @@ struct ivi_layout;
|
|||||||
|
|
||||||
struct ivi_layout_screen {
|
struct ivi_layout_screen {
|
||||||
struct wl_list link;
|
struct wl_list link;
|
||||||
struct wl_list link_to_layer;
|
|
||||||
uint32_t id_screen;
|
uint32_t id_screen;
|
||||||
|
|
||||||
struct ivi_layout *layout;
|
struct ivi_layout *layout;
|
||||||
@ -164,16 +157,6 @@ remove_link_to_surface(struct ivi_layout_layer *ivilayer)
|
|||||||
wl_list_init(&ivilayer->link_to_surface);
|
wl_list_init(&ivilayer->link_to_surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Internal API to add a link to ivi_layer from ivi_screen.
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
add_link_to_layer(struct ivi_layout_screen *iviscrn,
|
|
||||||
struct link_screen *link_screen)
|
|
||||||
{
|
|
||||||
wl_list_insert(&iviscrn->link_to_layer, &link_screen->link_to_screen);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal API to add/remove a ivi_surface from ivi_layer.
|
* Internal API to add/remove a ivi_surface from ivi_layer.
|
||||||
*/
|
*/
|
||||||
@ -208,40 +191,6 @@ remove_ordersurface_from_layer(struct ivi_layout_surface *ivisurf)
|
|||||||
wl_list_init(&ivisurf->layer_list);
|
wl_list_init(&ivisurf->layer_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Internal API to add/remove a ivi_layer to/from ivi_screen.
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
add_orderlayer_to_screen(struct ivi_layout_layer *ivilayer,
|
|
||||||
struct ivi_layout_screen *iviscrn)
|
|
||||||
{
|
|
||||||
struct link_screen *link_scrn = NULL;
|
|
||||||
|
|
||||||
link_scrn = malloc(sizeof *link_scrn);
|
|
||||||
if (link_scrn == NULL) {
|
|
||||||
weston_log("fails to allocate memory\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
link_scrn->iviscrn = iviscrn;
|
|
||||||
wl_list_insert(&ivilayer->screen_list, &link_scrn->link);
|
|
||||||
add_link_to_layer(iviscrn, link_scrn);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
remove_orderlayer_from_screen(struct ivi_layout_layer *ivilayer)
|
|
||||||
{
|
|
||||||
struct link_screen *link_scrn = NULL;
|
|
||||||
struct link_screen *next = NULL;
|
|
||||||
|
|
||||||
wl_list_for_each_safe(link_scrn, next, &ivilayer->screen_list, link) {
|
|
||||||
wl_list_remove(&link_scrn->link);
|
|
||||||
wl_list_remove(&link_scrn->link_to_screen);
|
|
||||||
free(link_scrn);
|
|
||||||
}
|
|
||||||
wl_list_init(&ivilayer->screen_list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal API to add/remove a ivi_layer to/from ivi_screen.
|
* Internal API to add/remove a ivi_layer to/from ivi_screen.
|
||||||
*/
|
*/
|
||||||
@ -422,8 +371,6 @@ create_screen(struct weston_compositor *ec)
|
|||||||
wl_list_init(&iviscrn->order.layer_list);
|
wl_list_init(&iviscrn->order.layer_list);
|
||||||
wl_list_init(&iviscrn->order.link);
|
wl_list_init(&iviscrn->order.link);
|
||||||
|
|
||||||
wl_list_init(&iviscrn->link_to_layer);
|
|
||||||
|
|
||||||
wl_list_insert(&layout->screen_list, &iviscrn->link);
|
wl_list_insert(&layout->screen_list, &iviscrn->link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -964,7 +911,7 @@ commit_screen_list(struct ivi_layout *layout)
|
|||||||
if (iviscrn->order.dirty) {
|
if (iviscrn->order.dirty) {
|
||||||
wl_list_for_each_safe(ivilayer, next,
|
wl_list_for_each_safe(ivilayer, next,
|
||||||
&iviscrn->order.layer_list, order.link) {
|
&iviscrn->order.layer_list, order.link) {
|
||||||
remove_orderlayer_from_screen(ivilayer);
|
ivilayer->on_screen = NULL;
|
||||||
wl_list_remove(&ivilayer->order.link);
|
wl_list_remove(&ivilayer->order.link);
|
||||||
wl_list_init(&ivilayer->order.link);
|
wl_list_init(&ivilayer->order.link);
|
||||||
ivilayer->event_mask |= IVI_NOTIFICATION_REMOVE;
|
ivilayer->event_mask |= IVI_NOTIFICATION_REMOVE;
|
||||||
@ -976,7 +923,7 @@ commit_screen_list(struct ivi_layout *layout)
|
|||||||
pending.link) {
|
pending.link) {
|
||||||
wl_list_insert(&iviscrn->order.layer_list,
|
wl_list_insert(&iviscrn->order.layer_list,
|
||||||
&ivilayer->order.link);
|
&ivilayer->order.link);
|
||||||
add_orderlayer_to_screen(ivilayer, iviscrn);
|
ivilayer->on_screen = iviscrn;
|
||||||
ivilayer->event_mask |= IVI_NOTIFICATION_ADD;
|
ivilayer->event_mask |= IVI_NOTIFICATION_ADD;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1596,7 +1543,6 @@ ivi_layout_get_screens_under_layer(struct ivi_layout_layer *ivilayer,
|
|||||||
int32_t *pLength,
|
int32_t *pLength,
|
||||||
struct ivi_layout_screen ***ppArray)
|
struct ivi_layout_screen ***ppArray)
|
||||||
{
|
{
|
||||||
struct link_screen *link_scrn = NULL;
|
|
||||||
int32_t length = 0;
|
int32_t length = 0;
|
||||||
int32_t n = 0;
|
int32_t n = 0;
|
||||||
|
|
||||||
@ -1605,7 +1551,8 @@ ivi_layout_get_screens_under_layer(struct ivi_layout_layer *ivilayer,
|
|||||||
return IVI_FAILED;
|
return IVI_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
length = wl_list_length(&ivilayer->screen_list);
|
if (ivilayer->on_screen != NULL)
|
||||||
|
length = 1;
|
||||||
|
|
||||||
if (length != 0) {
|
if (length != 0) {
|
||||||
/* the Array must be free by module which called this function */
|
/* the Array must be free by module which called this function */
|
||||||
@ -1615,9 +1562,7 @@ ivi_layout_get_screens_under_layer(struct ivi_layout_layer *ivilayer,
|
|||||||
return IVI_FAILED;
|
return IVI_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
wl_list_for_each(link_scrn, &ivilayer->screen_list, link) {
|
(*ppArray)[n++] = ivilayer->on_screen;
|
||||||
(*ppArray)[n++] = link_scrn->iviscrn;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*pLength = length;
|
*pLength = length;
|
||||||
@ -1816,7 +1761,6 @@ ivi_layout_layer_create_with_dimension(uint32_t id_layer,
|
|||||||
|
|
||||||
ivilayer->ref_count = 1;
|
ivilayer->ref_count = 1;
|
||||||
wl_signal_init(&ivilayer->property_changed);
|
wl_signal_init(&ivilayer->property_changed);
|
||||||
wl_list_init(&ivilayer->screen_list);
|
|
||||||
wl_list_init(&ivilayer->link_to_surface);
|
wl_list_init(&ivilayer->link_to_surface);
|
||||||
ivilayer->layout = layout;
|
ivilayer->layout = layout;
|
||||||
ivilayer->id_layer = id_layer;
|
ivilayer->id_layer = id_layer;
|
||||||
@ -1884,7 +1828,6 @@ ivi_layout_layer_destroy(struct ivi_layout_layer *ivilayer)
|
|||||||
wl_list_remove(&ivilayer->order.link);
|
wl_list_remove(&ivilayer->order.link);
|
||||||
wl_list_remove(&ivilayer->link);
|
wl_list_remove(&ivilayer->link);
|
||||||
|
|
||||||
remove_orderlayer_from_screen(ivilayer);
|
|
||||||
remove_link_to_surface(ivilayer);
|
remove_link_to_surface(ivilayer);
|
||||||
ivi_layout_layer_remove_notification(ivilayer);
|
ivi_layout_layer_remove_notification(ivilayer);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user