ivi-shell: multi screen support to calcuration of a mask of weston_surface.

A weston_surface is transformed to multi screen coordinate, global
coordinate by matrix:m now.

Additionally, a mask needs to be calucated, taking account into,
- multi screen coordination: a destination rectangle of layer in the
  coordination is easily calcurated by adding weston_output.{x,y} in
  simple. This is because there is no scaled and rotated transformation.
- intersect inside of a screen the layer is assigned to. This is because
  overlapped region of weston surface in another screen shall not be
  displayed according to ivi use case.

Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
dev
Nobuhiko Tanibata 9 years ago committed by Pekka Paalanen
parent 29babdf099
commit 1c2618e9ff
  1. 36
      ivi-shell/ivi-layout.c

@ -518,15 +518,24 @@ calc_inverse_matrix_transform(const struct weston_matrix *matrix,
/** /**
* This computes the whole transformation matrix:m from surface-local * This computes the whole transformation matrix:m from surface-local
* coordinates to global coordinates. It is assumed that * coordinates to multi screens coordinate, which is global coordinates.
* weston_view::geometry.{x,y} are zero. * It is assumed that weston_view::geometry.{x,y} are zero.
* *
* Additionally, this computes the mask on surface-local coordinates as a * Additionally, this computes the mask on surface-local coordinates as a
* ivi_rectangle. This can be set to weston_view_set_mask. * ivi_rectangle. This can be set to weston_view_set_mask.
* *
* The mask is computed by following steps * The mask is computed by following steps
* - destination rectangle of layer is inversed to surface-local cooodinates * - destination rectangle of layer is tansformed to multi screen coordinate,
* by inversed matrix:m. * global coordinates. This is done by adding weston_output.{x,y} in simple
* because there is no scaled and rotated transformation.
* - destination rectangle of layer in multi screens coordinate needs to be
* intersected inside of a screen the layer is assigned to. This is because
* overlapped region of weston surface in another screen shall not be
* displayed according to ivi use case.
* - destination rectangle of layer
* - in multi screen coordinates,
* - and intersected inside of an assigned screen,
* is inversed to surface-local cooodinates by inversed matrix:m.
* - the area is intersected by intersected area between weston_surface and * - the area is intersected by intersected area between weston_surface and
* source rectangle of ivi_surface. * source rectangle of ivi_surface.
*/ */
@ -561,7 +570,17 @@ calc_surface_to_global_matrix_and_mask_to_weston_surface(
lp->dest_y, lp->dest_y,
lp->dest_width, lp->dest_width,
lp->dest_height }; lp->dest_height };
struct ivi_rectangle screen_dest_rect = { output->x,
output->y,
output->width,
output->height };
struct ivi_rectangle layer_dest_rect_in_global =
{ lp->dest_x + output->x,
lp->dest_y + output->y,
lp->dest_width,
lp->dest_height };
struct ivi_rectangle surface_result; struct ivi_rectangle surface_result;
struct ivi_rectangle layer_dest_rect_in_global_intersected;
/* /*
* the whole transformation matrix:m from surface-local * the whole transformation matrix:m from surface-local
@ -588,9 +607,16 @@ calc_surface_to_global_matrix_and_mask_to_weston_surface(
ivi_rectangle_intersect(&surface_source_rect, &weston_surface_rect, ivi_rectangle_intersect(&surface_source_rect, &weston_surface_rect,
&surface_result); &surface_result);
/*
* destination rectangle of layer in multi screens coordinate
* is intersected to avoid displaying outside of an assigned screen.
*/
ivi_rectangle_intersect(&layer_dest_rect_in_global, &screen_dest_rect,
&layer_dest_rect_in_global_intersected);
/* calc masking area of weston_surface from m */ /* calc masking area of weston_surface from m */
calc_inverse_matrix_transform(m, calc_inverse_matrix_transform(m,
&layer_dest_rect, &layer_dest_rect_in_global_intersected,
&surface_result, &surface_result,
result); result);
} }

Loading…
Cancel
Save