ivi-shell: remove orientation calculation
Dead code as orientation cannot be changed anymore, see patches: ivi-shell: remove layer_set_orientation API ivi-shell: remove surface_set_orientation API Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> [Pekka: added commit message] Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
committed by
Pekka Paalanen
parent
6e423ed996
commit
57ac260c5d
+4
-76
@@ -321,72 +321,13 @@ update_opacity(struct ivi_layout_layer *ivilayer,
|
|||||||
view->alpha = layer_alpha * surf_alpha;
|
view->alpha = layer_alpha * surf_alpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
get_rotate_values(enum wl_output_transform orientation,
|
|
||||||
float *v_sin,
|
|
||||||
float *v_cos)
|
|
||||||
{
|
|
||||||
switch (orientation) {
|
|
||||||
case WL_OUTPUT_TRANSFORM_90:
|
|
||||||
*v_sin = 1.0f;
|
|
||||||
*v_cos = 0.0f;
|
|
||||||
break;
|
|
||||||
case WL_OUTPUT_TRANSFORM_180:
|
|
||||||
*v_sin = 0.0f;
|
|
||||||
*v_cos = -1.0f;
|
|
||||||
break;
|
|
||||||
case WL_OUTPUT_TRANSFORM_270:
|
|
||||||
*v_sin = -1.0f;
|
|
||||||
*v_cos = 0.0f;
|
|
||||||
break;
|
|
||||||
case WL_OUTPUT_TRANSFORM_NORMAL:
|
|
||||||
default:
|
|
||||||
*v_sin = 0.0f;
|
|
||||||
*v_cos = 1.0f;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
get_scale(enum wl_output_transform orientation,
|
|
||||||
float dest_width,
|
|
||||||
float dest_height,
|
|
||||||
float source_width,
|
|
||||||
float source_height,
|
|
||||||
float *scale_x,
|
|
||||||
float *scale_y)
|
|
||||||
{
|
|
||||||
switch (orientation) {
|
|
||||||
case WL_OUTPUT_TRANSFORM_90:
|
|
||||||
*scale_x = dest_width / source_height;
|
|
||||||
*scale_y = dest_height / source_width;
|
|
||||||
break;
|
|
||||||
case WL_OUTPUT_TRANSFORM_180:
|
|
||||||
*scale_x = dest_width / source_width;
|
|
||||||
*scale_y = dest_height / source_height;
|
|
||||||
break;
|
|
||||||
case WL_OUTPUT_TRANSFORM_270:
|
|
||||||
*scale_x = dest_width / source_height;
|
|
||||||
*scale_y = dest_height / source_width;
|
|
||||||
break;
|
|
||||||
case WL_OUTPUT_TRANSFORM_NORMAL:
|
|
||||||
default:
|
|
||||||
*scale_x = dest_width / source_width;
|
|
||||||
*scale_y = dest_height / source_height;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
calc_transformation_matrix(struct ivi_rectangle *source_rect,
|
calc_transformation_matrix(struct ivi_rectangle *source_rect,
|
||||||
struct ivi_rectangle *dest_rect,
|
struct ivi_rectangle *dest_rect,
|
||||||
enum wl_output_transform orientation,
|
|
||||||
struct weston_matrix *m)
|
struct weston_matrix *m)
|
||||||
{
|
{
|
||||||
float source_center_x;
|
float source_center_x;
|
||||||
float source_center_y;
|
float source_center_y;
|
||||||
float vsin;
|
|
||||||
float vcos;
|
|
||||||
float scale_x;
|
float scale_x;
|
||||||
float scale_y;
|
float scale_y;
|
||||||
float translate_x;
|
float translate_x;
|
||||||
@@ -396,16 +337,8 @@ calc_transformation_matrix(struct ivi_rectangle *source_rect,
|
|||||||
source_center_y = source_rect->y + source_rect->height * 0.5f;
|
source_center_y = source_rect->y + source_rect->height * 0.5f;
|
||||||
weston_matrix_translate(m, -source_center_x, -source_center_y, 0.0f);
|
weston_matrix_translate(m, -source_center_x, -source_center_y, 0.0f);
|
||||||
|
|
||||||
get_rotate_values(orientation, &vsin, &vcos);
|
scale_x = (float) dest_rect->width / (float) source_rect->width;
|
||||||
weston_matrix_rotate_xy(m, vcos, vsin);
|
scale_y = (float) dest_rect->height / (float) source_rect->height;
|
||||||
|
|
||||||
get_scale(orientation,
|
|
||||||
dest_rect->width,
|
|
||||||
dest_rect->height,
|
|
||||||
source_rect->width,
|
|
||||||
source_rect->height,
|
|
||||||
&scale_x,
|
|
||||||
&scale_y);
|
|
||||||
weston_matrix_scale(m, scale_x, scale_y, 1.0f);
|
weston_matrix_scale(m, scale_x, scale_y, 1.0f);
|
||||||
|
|
||||||
translate_x = dest_rect->width * 0.5f + dest_rect->x;
|
translate_x = dest_rect->width * 0.5f + dest_rect->x;
|
||||||
@@ -582,13 +515,8 @@ calc_surface_to_global_matrix_and_mask_to_weston_surface(
|
|||||||
* - single screen-local coordinates to multi-screen coordinates,
|
* - single screen-local coordinates to multi-screen coordinates,
|
||||||
* which are global coordinates.
|
* which are global coordinates.
|
||||||
*/
|
*/
|
||||||
calc_transformation_matrix(&surface_source_rect,
|
calc_transformation_matrix(&surface_source_rect, &surface_dest_rect, m);
|
||||||
&surface_dest_rect,
|
calc_transformation_matrix(&layer_source_rect, &layer_dest_rect, m);
|
||||||
sp->orientation, m);
|
|
||||||
|
|
||||||
calc_transformation_matrix(&layer_source_rect,
|
|
||||||
&layer_dest_rect,
|
|
||||||
lp->orientation, m);
|
|
||||||
|
|
||||||
weston_matrix_translate(m, output->x, output->y, 0.0f);
|
weston_matrix_translate(m, output->x, output->y, 0.0f);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user