[RFC weston 16/16] compositor: Remove weston_transformed_rect() and weston_transformed_coord()

Derek Foreman derekf at osg.samsung.com
Fri Sep 26 14:10:27 PDT 2014


The last caller of weston_transformed_rect() has been replaced so we can
remove weston_transformed_rect() - since it was the last caller of
weston_transformed_coord() we can get rid of that too.
---
 src/compositor.c | 80 --------------------------------------------------------
 src/compositor.h | 10 -------
 2 files changed, 90 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index 2f21a36..234e9ea 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -626,86 +626,6 @@ weston_matrix_transform_rect(struct weston_matrix *matrix,
 }
 
 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 = height - sy;
-		*by = sx;
-		break;
-	case WL_OUTPUT_TRANSFORM_FLIPPED_90:
-		*bx = height - sy;
-		*by = width - 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 = sy;
-		*by = width - sx;
-		break;
-	case WL_OUTPUT_TRANSFORM_FLIPPED_270:
-		*bx = sy;
-		*by = sx;
-		break;
-	}
-
-	*bx *= scale;
-	*by *= scale;
-}
-
-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;
-}
-
-WL_EXPORT void
 weston_matrix_transform_region(pixman_region32_t *dest,
 			       struct weston_matrix *matrix,
 			       pixman_region32_t *src)
diff --git a/src/compositor.h b/src/compositor.h
index 26f81c4..c87bcb6 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -1430,16 +1430,6 @@ 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);
-- 
2.1.0



More information about the wayland-devel mailing list