shell: Move weston_curtain_create params into the struct

Given that we have a struct for argument params, we might as well use it
rather than have them split between the struct and native params. For
consistency between the implementations, this also includes a shift from
float to int positioning for the base offset within the compositor's
global co-ordinate space.

Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone
2022-01-17 14:05:06 +00:00
parent 3a298b0b05
commit d21563360a
5 changed files with 21 additions and 16 deletions
+7 -6
View File
@@ -140,8 +140,7 @@ surface_get_label(struct weston_surface *surface, char *buf, size_t len)
struct weston_view *
weston_curtain_create(struct weston_compositor *compositor,
struct weston_curtain_params *params,
float x, float y, int w, int h)
struct weston_curtain_params *params)
{
struct weston_surface *surface = NULL;
struct weston_view *view;
@@ -164,12 +163,14 @@ weston_curtain_create(struct weston_compositor *compositor,
weston_surface_set_color(surface, params->r, params->g, params->b, 1.0);
weston_surface_set_label_func(surface, params->get_label);
pixman_region32_fini(&surface->opaque);
pixman_region32_init_rect(&surface->opaque, 0, 0, w, h);
pixman_region32_init_rect(&surface->opaque, 0, 0,
params->width, params->height);
pixman_region32_fini(&surface->input);
pixman_region32_init_rect(&surface->input, 0, 0, w, h);
pixman_region32_init_rect(&surface->input, 0, 0,
params->width, params->height);
weston_surface_set_size(surface, w, h);
weston_view_set_position(view, x, y);
weston_surface_set_size(surface, params->width, params->height);
weston_view_set_position(view, params->x, params->y);
return view;
}
+2 -2
View File
@@ -32,6 +32,7 @@ struct weston_curtain_params {
void (*surface_committed)(struct weston_surface *es, int32_t sx, int32_t sy);
void *surface_private;
float r, g, b;
int x, y, width, height;
};
struct weston_output *
@@ -54,5 +55,4 @@ surface_get_label(struct weston_surface *surface, char *buf, size_t len);
*/
struct weston_view *
weston_curtain_create(struct weston_compositor *compositor,
struct weston_curtain_params *ss,
float x, float y, int w, int h);
struct weston_curtain_params *params);