[PATCH weston 08/11] ivi-shell: hmi-controller supports multi screens at tiling mode.

Nobuhiko Tanibata nobuhiko_tanibata at xddp.denso.co.jp
Tue Dec 8 22:43:30 PST 2015


From: Nobuhiko Tanibata <NOBUHIKO_TANIBATA at xddp.denso.co.jp>

It shows 8 ivi applications in a screen at tiling. It moves additional
application more than 8xN to next screen N+1.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA at xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---
 ivi-shell/hmi-controller.c | 38 ++++++++++++++++++++++----------------
 1 file changed, 22 insertions(+), 16 deletions(-)

diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c
index 4b20848..d5b11ed 100644
--- a/ivi-shell/hmi-controller.c
+++ b/ivi-shell/hmi-controller.c
@@ -224,10 +224,11 @@ mode_divided_into_tiling(struct hmi_controller *hmi_ctrl,
 	struct ivi_layout_surface **surfaces;
 	struct ivi_layout_surface **new_order;
 	const uint32_t duration = hmi_ctrl->hmi_setting->transition_duration;
+	struct ivi_layout_layer *ivilayer = NULL;
 
 	int32_t i = 0;
 	int32_t surf_num = 0;
-	uint32_t num = 1;
+	int32_t idx = 0;
 
 	surfaces = MEM_ALLOC(sizeof(*surfaces) * surface_length);
 	new_order = MEM_ALLOC(sizeof(*surfaces) * surface_length);
@@ -242,16 +243,23 @@ mode_divided_into_tiling(struct hmi_controller *hmi_ctrl,
 		surfaces[surf_num++] = ivisurf;
 	}
 
-	for (i = 0; i < surf_num; i++) {
-		ivisurf = surfaces[i];
-		new_order[i] = ivisurf;
+	wl_list_for_each_reverse(layer, layer_list, link) {
+		if (idx >= surf_num)
+			break;
+
+		ivilayer = layer->ivilayer;
 
-		if (num <= 8) {
-			if (num < 5) {
-				surface_x = (int32_t)((num - 1) * (surface_width));
+		for (i = 0; i < 8; i++, idx++) {
+			if (idx >= surf_num)
+				break;
+
+			ivisurf = surfaces[idx];
+			new_order[i] = ivisurf;
+			if (i < 4) {
+				surface_x = (int32_t)(i * (surface_width));
 				surface_y = 0;
 			} else {
-				surface_x = (int32_t)((num - 5) * (surface_width));
+				surface_x = (int32_t)((i - 4) * (surface_width));
 				surface_y = (int32_t)surface_height;
 			}
 
@@ -264,17 +272,15 @@ mode_divided_into_tiling(struct hmi_controller *hmi_ctrl,
 					(int32_t)surface_width,
 					(int32_t)surface_height);
 
-			num++;
-			continue;
 		}
-		ivi_layout_interface->surface_set_visibility(ivisurf, false);
-	}
+		ivi_layout_interface->layer_set_render_order(ivilayer, new_order, i);
 
-	if (surf_num > 0) {
-		ivi_layout_interface->layer_set_transition(layer->ivilayer,
-				IVI_LAYOUT_TRANSITION_LAYER_VIEW_ORDER,
-				duration);
+		ivi_layout_interface->layer_set_transition(ivilayer,
+					IVI_LAYOUT_TRANSITION_LAYER_VIEW_ORDER,
+					duration);
 	}
+	for (i = idx; i < surf_num; i++)
+		ivi_layout_interface->surface_set_visibility(surfaces[i], false);
 
 	free(surfaces);
 	free(new_order);
-- 
1.8.3.1



More information about the wayland-devel mailing list