shell: Add alpha to weston_curtain_create
Not all solid-colour views want to be opaque: sometimes we use them with non-opaque alpha values in order to shade views underneath them. Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
+10
-3
@@ -160,11 +160,18 @@ weston_curtain_create(struct weston_compositor *compositor,
|
||||
surface->committed = params->surface_committed;
|
||||
surface->committed_private = params->surface_private;
|
||||
|
||||
weston_surface_set_color(surface, params->r, params->g, params->b, 1.0);
|
||||
weston_surface_set_color(surface,
|
||||
params->r, params->g, params->b, params->a);
|
||||
weston_surface_set_label_func(surface, params->get_label);
|
||||
|
||||
pixman_region32_fini(&surface->opaque);
|
||||
pixman_region32_init_rect(&surface->opaque, 0, 0,
|
||||
params->width, params->height);
|
||||
if (params->a == 1.0) {
|
||||
pixman_region32_init_rect(&surface->opaque, 0, 0,
|
||||
params->width, params->height);
|
||||
} else {
|
||||
pixman_region32_init(&surface->opaque);
|
||||
}
|
||||
|
||||
pixman_region32_fini(&surface->input);
|
||||
pixman_region32_init_rect(&surface->input, 0, 0,
|
||||
params->width, params->height);
|
||||
|
||||
@@ -31,7 +31,7 @@ struct weston_curtain_params {
|
||||
int (*get_label)(struct weston_surface *es, char *buf, size_t len);
|
||||
void (*surface_committed)(struct weston_surface *es, int32_t sx, int32_t sy);
|
||||
void *surface_private;
|
||||
float r, g, b;
|
||||
float r, g, b, a;
|
||||
int x, y, width, height;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user