summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>2015-12-09 15:38:41 +0900
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-12-14 13:16:11 +0200
commit29babdf099fee228883ab6425811f11135296274 (patch)
tree941ab6d1addb315bce24b890f0a247cb5e1c840e
parentb4cb25dc261375bad87d1c1dd058b9716009e6fb (diff)
ivi-shell: convert from screen to global coordinates
In single screen, the coordinates of layer local coordinates are the same as global coordinates. However, to support multi screens, the layer-local coordinates shall be transformed to multi screen coordinates, which is global coordinates. The abosolute coordinates of a screen in global stored in (x,y) of output of its weston output so it shall be used to transform layer-local to global coordinates. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-rw-r--r--ivi-shell/ivi-layout.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index 724ca6fe..6d017998 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -532,6 +532,7 @@ calc_inverse_matrix_transform(const struct weston_matrix *matrix,
*/
static void
calc_surface_to_global_matrix_and_mask_to_weston_surface(
+ struct ivi_layout_screen *iviscrn,
struct ivi_layout_layer *ivilayer,
struct ivi_layout_surface *ivisurf,
struct weston_matrix *m,
@@ -539,6 +540,7 @@ calc_surface_to_global_matrix_and_mask_to_weston_surface(
{
const struct ivi_layout_surface_properties *sp = &ivisurf->prop;
const struct ivi_layout_layer_properties *lp = &ivilayer->prop;
+ struct weston_output *output = iviscrn->output;
struct ivi_rectangle weston_surface_rect = { 0,
0,
ivisurf->surface->width,
@@ -566,7 +568,9 @@ calc_surface_to_global_matrix_and_mask_to_weston_surface(
* coordinates to global coordinates, which is computed by
* two steps,
* - surface-local coordinates to layer-local coordinates
- * - layer-local coordinates to global coordinates
+ * - layer-local coordinates to a single screen-local coordinates
+ * - a single screen-local coordinates to multi screen coordinates,
+ * which is global coordinates.
*/
calc_transformation_matrix(&surface_source_rect,
&surface_dest_rect,
@@ -576,6 +580,8 @@ calc_surface_to_global_matrix_and_mask_to_weston_surface(
&layer_dest_rect,
lp->orientation, m);
+ weston_matrix_translate(m, output->x, output->y, 0.0f);
+
/* this intersected ivi_rectangle would be used for masking
* weston_surface
*/
@@ -622,7 +628,7 @@ update_prop(struct ivi_layout_screen *iviscrn,
weston_matrix_init(&ivisurf->transform.matrix);
calc_surface_to_global_matrix_and_mask_to_weston_surface(
- ivilayer, ivisurf, &ivisurf->transform.matrix, &r);
+ iviscrn, ivilayer, ivisurf, &ivisurf->transform.matrix, &r);
weston_view_set_mask(tmpview, r.x, r.y, r.width, r.height);
wl_list_insert(&tmpview->geometry.transformation_list,