compositor: Remove weston_transformed_ functions

These no longer have any callers, so they can go.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2022-01-21 10:43:27 -06:00 committed by Pekka Paalanen
parent c12ec7a2e5
commit 2e5b62079b
2 changed files with 0 additions and 125 deletions

View file

@ -702,121 +702,6 @@ weston_matrix_transform_rect(struct weston_matrix *matrix,
return out;
}
/** Transform a point to buffer coordinates
*
* \param width Surface width.
* \param height Surface height.
* \param transform Buffer transform.
* \param scale Buffer scale.
* \param sx Surface x coordinate of a point.
* \param sy Surface y coordinate of a point.
* \param[out] bx Buffer x coordinate of the point.
* \param[out] by Buffer Y coordinate of the point.
*
* Converts the given surface-local coordinates to buffer coordinates
* according to the given buffer transform and scale.
* This ignores wp_viewport.
*
* The given width and height must be the result of inverse scaled and
* inverse transformed buffer size.
*/
WL_EXPORT void
weston_transformed_coord(int width, int height,
enum wl_output_transform transform,
int32_t scale,
float sx, float sy, float *bx, float *by)
{
switch (transform) {
case WL_OUTPUT_TRANSFORM_NORMAL:
default:
*bx = sx;
*by = sy;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED:
*bx = width - sx;
*by = sy;
break;
case WL_OUTPUT_TRANSFORM_90:
*bx = sy;
*by = width - sx;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
*bx = sy;
*by = sx;
break;
case WL_OUTPUT_TRANSFORM_180:
*bx = width - sx;
*by = height - sy;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED_180:
*bx = sx;
*by = height - sy;
break;
case WL_OUTPUT_TRANSFORM_270:
*bx = height - sy;
*by = sx;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
*bx = height - sy;
*by = width - sx;
break;
}
*bx *= scale;
*by *= scale;
}
/** Transform a rectangle to buffer coordinates
*
* \param width Surface width.
* \param height Surface height.
* \param transform Buffer transform.
* \param scale Buffer scale.
* \param rect Rectangle in surface coordinates.
* \return Rectangle in buffer coordinates.
*
* Converts the given surface-local rectangle to buffer coordinates
* according to the given buffer transform and scale. The resulting
* rectangle is guaranteed to be well-formed.
* This ignores wp_viewport.
*
* The given width and height must be the result of inverse scaled and
* inverse transformed buffer size.
*/
WL_EXPORT pixman_box32_t
weston_transformed_rect(int width, int height,
enum wl_output_transform transform,
int32_t scale,
pixman_box32_t rect)
{
float x1, x2, y1, y2;
pixman_box32_t ret;
weston_transformed_coord(width, height, transform, scale,
rect.x1, rect.y1, &x1, &y1);
weston_transformed_coord(width, height, transform, scale,
rect.x2, rect.y2, &x2, &y2);
if (x1 <= x2) {
ret.x1 = x1;
ret.x2 = x2;
} else {
ret.x1 = x2;
ret.x2 = x1;
}
if (y1 <= y2) {
ret.y1 = y1;
ret.y2 = y2;
} else {
ret.y1 = y2;
ret.y2 = y1;
}
return ret;
}
/** Transform a region by a matrix
*
* Warning: This function does not work perfectly for projective,

View file

@ -337,16 +337,6 @@ pixman_box32_t
weston_matrix_transform_rect(struct weston_matrix *matrix,
pixman_box32_t rect);
void
weston_transformed_coord(int width, int height,
enum wl_output_transform transform,
int32_t scale,
float sx, float sy, float *bx, float *by);
pixman_box32_t
weston_transformed_rect(int width, int height,
enum wl_output_transform transform,
int32_t scale,
pixman_box32_t rect);
void
weston_matrix_transform_region(pixman_region32_t *dest,
struct weston_matrix *matrix,
pixman_region32_t *src);