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

Submitted by Nobuhiko Tanibata on Dec. 9, 2015, 6:43 a.m.

Details

Message ID 1449643410-23179-1-git-send-email-nobuhiko_tanibata@xddp.denso.co.jp
State Accepted
Commit a8aa91c0d1cb16bab00145c966e1ee139168fcef
Headers show
Series "ivi-shell: multi screen supprot" ( rev: 2 ) in Wayland (DEPRECATED)

Not browsing as part of any series.

Commit Message

Nobuhiko Tanibata Dec. 9, 2015, 6:43 a.m.
From: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@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@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
---
 ivi-shell/hmi-controller.c | 38 ++++++++++++++++++++++----------------
 1 file changed, 22 insertions(+), 16 deletions(-)

Patch hide | download patch | download mbox

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);