[PATCH weston 2/3] compositor: turn weston_view::transform.opaque into masked

Pekka Paalanen ppaalanen at gmail.com
Thu Feb 19 01:27:47 PST 2015


From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

Turns out there were no users of weston_view::transform.opaque,
everything was already using transform.masked_opaque. Therefore
repurpose transform.opaque as masked_opaque, and remove masked_opaque
member.

Now this opaque region in global coordinates is clipped by the layer
mask, if set. There are no cases where you would need the opaque region
without the effect of layer mask.

Also add a note in compositor.h, that changing view's layer counts as
changing geometry, which requires calling weston_view_geometry_dirty()
to let all derived state update.

Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
Cc: Giulio Camuffo <giuliocamuffo at gmail.com>
---
 src/compositor.c | 9 ++++-----
 src/compositor.h | 3 +--
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index c40f3eb..70a7768 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -444,7 +444,6 @@ weston_view_create(struct weston_surface *surface)
 
 	pixman_region32_init(&view->clip);
 	pixman_region32_init(&view->transform.masked_boundingbox);
-	pixman_region32_init(&view->transform.masked_opaque);
 
 	view->alpha = 1.0;
 	pixman_region32_init(&view->transform.opaque);
@@ -1237,8 +1236,8 @@ weston_view_update_transform(struct weston_view *view)
 		pixman_region32_init_with_extents(&mask, &layer->mask);
 		pixman_region32_intersect(&view->transform.masked_boundingbox,
 					&view->transform.boundingbox, &mask);
-		pixman_region32_intersect(&view->transform.masked_opaque,
-					&view->transform.opaque, &mask);
+		pixman_region32_intersect(&view->transform.opaque,
+					  &view->transform.opaque, &mask);
 		pixman_region32_fini(&mask);
 	}
 
@@ -1634,7 +1633,7 @@ weston_view_destroy(struct weston_view *view)
 	pixman_region32_fini(&view->clip);
 	pixman_region32_fini(&view->transform.boundingbox);
 	pixman_region32_fini(&view->transform.masked_boundingbox);
-	pixman_region32_fini(&view->transform.masked_opaque);
+	pixman_region32_fini(&view->transform.opaque);
 
 	weston_view_set_transform_parent(view, NULL);
 
@@ -1842,7 +1841,7 @@ view_accumulate_damage(struct weston_view *view,
 			      &view->plane->damage, &damage);
 	pixman_region32_fini(&damage);
 	pixman_region32_copy(&view->clip, opaque);
-	pixman_region32_union(opaque, opaque, &view->transform.masked_opaque);
+	pixman_region32_union(opaque, opaque, &view->transform.opaque);
 }
 
 static void
diff --git a/src/compositor.h b/src/compositor.h
index a90ede6..f746258 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -757,7 +757,7 @@ struct weston_view {
 	struct wl_signal destroy_signal;
 
 	struct wl_list link;
-	struct weston_layer_entry layer_link;
+	struct weston_layer_entry layer_link; /* part of geometry */
 	struct weston_plane *plane;
 
 	/* For weston_layer inheritance from another view */
@@ -794,7 +794,6 @@ struct weston_view {
 		pixman_region32_t boundingbox;
 		pixman_region32_t opaque;
 		pixman_region32_t masked_boundingbox;
-		pixman_region32_t masked_opaque;
 
 		/* matrix and inverse are used only if enabled = 1.
 		 * If enabled = 0, use x, y, width, height directly.
-- 
2.0.5



More information about the wayland-devel mailing list