compositor: add a masking mechanism to weston_layer
this adds a mechanism to mask the views belonging to a layer
to an arbitrary rect, in the global space. The parts that don't fit
in that rect will be clipped away.
Supported by the gl and pixman renderer only for now.
diff --git a/src/compositor.h b/src/compositor.h
index 9bbd844..102cfa7 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -534,6 +534,7 @@
struct weston_layer {
struct weston_layer_entry view_list;
struct wl_list link;
+ pixman_box32_t mask;
};
struct weston_plane {
@@ -738,6 +739,7 @@
struct wl_list link;
struct weston_layer_entry layer_link;
struct weston_plane *plane;
+ struct weston_view *parent_view;
pixman_region32_t clip;
float alpha; /* part of geometry, see below */
@@ -769,6 +771,8 @@
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.
@@ -1010,6 +1014,12 @@
weston_layer_init(struct weston_layer *layer, struct wl_list *below);
void
+weston_layer_set_mask(struct weston_layer *layer, int x, int y, int width, int height);
+
+void
+weston_layer_set_mask_infinite(struct weston_layer *layer);
+
+void
weston_plane_init(struct weston_plane *plane,
struct weston_compositor *ec,
int32_t x, int32_t y);