compositor: turn weston_view::transform.opaque into masked

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@collabora.co.uk>
Reviewed-By: Giulio Camuffo <giuliocamuffo@gmail.com>
dev
Pekka Paalanen 10 years ago
parent 2d6e551a0b
commit 8844bf2ab0
  1. 7
      src/compositor.c
  2. 3
      src/compositor.h

@ -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,7 +1236,7 @@ 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,
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

@ -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.

Loading…
Cancel
Save