From b5605ccd2613eb6f34a33f1096f1a4b297391c55 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 18 Jan 2022 17:48:30 +0000 Subject: [PATCH] libweston: Remove weston_surface_set_color Don't do this; instead, create a solid-colour buffer and attach it to the surface explicitly. Signed-off-by: Daniel Stone --- include/libweston/libweston.h | 7 ------- libweston/compositor.c | 8 -------- libweston/noop-renderer.c | 7 ------- libweston/pixman-renderer.c | 1 - libweston/renderer-gl/gl-renderer.c | 1 - 5 files changed, 24 deletions(-) diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h index 09bc8bdd..58097205 100644 --- a/include/libweston/libweston.h +++ b/include/libweston/libweston.h @@ -929,9 +929,6 @@ struct weston_renderer { void (*flush_damage)(struct weston_surface *surface, struct weston_buffer *buffer); void (*attach)(struct weston_surface *es, struct weston_buffer *buffer); - void (*surface_set_color)(struct weston_surface *surface, - float red, float green, - float blue, float alpha); void (*destroy)(struct weston_compositor *ec); /** See weston_surface_get_content_size() */ @@ -1977,10 +1974,6 @@ struct weston_view_animation * weston_slide_run(struct weston_view *view, float start, float stop, weston_view_animation_done_func_t done, void *data); -void -weston_surface_set_color(struct weston_surface *surface, - float red, float green, float blue, float alpha); - void weston_surface_destroy(struct weston_surface *surface); diff --git a/libweston/compositor.c b/libweston/compositor.c index 2a84d56e..50598ef3 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -630,14 +630,6 @@ weston_surface_create(struct weston_compositor *compositor) return surface; } -WL_EXPORT void -weston_surface_set_color(struct weston_surface *surface, - float red, float green, float blue, float alpha) -{ - surface->compositor->renderer->surface_set_color(surface, red, green, blue, alpha); - surface->is_opaque = !(alpha < 1.0); -} - WL_EXPORT void weston_view_to_global_float(struct weston_view *view, float sx, float sy, float *x, float *y) diff --git a/libweston/noop-renderer.c b/libweston/noop-renderer.c index a7a1d5df..a105595f 100644 --- a/libweston/noop-renderer.c +++ b/libweston/noop-renderer.c @@ -96,12 +96,6 @@ noop_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer) buffer->height = height; } -static void -noop_renderer_surface_set_color(struct weston_surface *surface, - float red, float green, float blue, float alpha) -{ -} - static void noop_renderer_destroy(struct weston_compositor *ec) { @@ -122,7 +116,6 @@ noop_renderer_init(struct weston_compositor *ec) renderer->repaint_output = noop_renderer_repaint_output; renderer->flush_damage = noop_renderer_flush_damage; renderer->attach = noop_renderer_attach; - renderer->surface_set_color = noop_renderer_surface_set_color; renderer->destroy = noop_renderer_destroy; ec->renderer = renderer; diff --git a/libweston/pixman-renderer.c b/libweston/pixman-renderer.c index 361ffa61..636d9d91 100644 --- a/libweston/pixman-renderer.c +++ b/libweston/pixman-renderer.c @@ -881,7 +881,6 @@ pixman_renderer_init(struct weston_compositor *ec) renderer->base.repaint_output = pixman_renderer_repaint_output; renderer->base.flush_damage = pixman_renderer_flush_damage; renderer->base.attach = pixman_renderer_attach; - renderer->base.surface_set_color = pixman_renderer_surface_set_color; renderer->base.destroy = pixman_renderer_destroy; renderer->base.surface_get_content_size = pixman_renderer_surface_get_content_size; diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c index 557c0c1d..b29b4ad3 100644 --- a/libweston/renderer-gl/gl-renderer.c +++ b/libweston/renderer-gl/gl-renderer.c @@ -3733,7 +3733,6 @@ gl_renderer_display_create(struct weston_compositor *ec, gr->base.repaint_output = gl_renderer_repaint_output; gr->base.flush_damage = gl_renderer_flush_damage; gr->base.attach = gl_renderer_attach; - gr->base.surface_set_color = gl_renderer_surface_set_color; gr->base.destroy = gl_renderer_destroy; gr->base.surface_get_content_size = gl_renderer_surface_get_content_size;