pixman-renderer: Remove renderbuffer_get_image() function

renderbuffer_get_image() is only used by the X11 backend to retrieve
the size of the renderbuffer. The previous commit assumes that
renderbuffers are created at the size of the associated output so the
renderbuffer size can now be retrieved from the output.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
This commit is contained in:
Loïc Molinari 2024-08-09 14:42:31 +02:00
parent 96c49d91a5
commit 1d167d883f
3 changed files with 7 additions and 24 deletions

View file

@ -511,8 +511,6 @@ static int
x11_output_repaint_shm(struct weston_output *output_base) x11_output_repaint_shm(struct weston_output *output_base)
{ {
struct x11_output *output = to_x11_output(output_base); struct x11_output *output = to_x11_output(output_base);
const struct weston_renderer *renderer;
pixman_image_t *image;
struct weston_compositor *ec; struct weston_compositor *ec;
struct x11_backend *b; struct x11_backend *b;
xcb_void_cookie_t cookie; xcb_void_cookie_t cookie;
@ -522,11 +520,8 @@ x11_output_repaint_shm(struct weston_output *output_base)
assert(output); assert(output);
ec = output->base.compositor; ec = output->base.compositor;
renderer = ec->renderer;
b = output->backend; b = output->backend;
image = renderer->pixman->renderbuffer_get_image(output->renderbuffer);
pixman_region32_init(&damage); pixman_region32_init(&damage);
weston_output_flush_damage_for_primary_plane(output_base, &damage); weston_output_flush_damage_for_primary_plane(output_base, &damage);
@ -538,11 +533,11 @@ x11_output_repaint_shm(struct weston_output *output_base)
pixman_region32_fini(&damage); pixman_region32_fini(&damage);
cookie = xcb_shm_put_image_checked(b->conn, output->window, output->gc, cookie = xcb_shm_put_image_checked(b->conn, output->window, output->gc,
pixman_image_get_width(image), output_base->current_mode->width,
pixman_image_get_height(image), output_base->current_mode->height,
0, 0, 0, 0,
pixman_image_get_width(image), output_base->current_mode->width,
pixman_image_get_height(image), output_base->current_mode->height,
0, 0, output->depth, XCB_IMAGE_FORMAT_Z_PIXMAP, 0, 0, output->depth, XCB_IMAGE_FORMAT_Z_PIXMAP,
0, output->segment, 0); 0, output->segment, 0);
err = xcb_request_check(b->conn, cookie); err = xcb_request_check(b->conn, cookie);

View file

@ -82,15 +82,6 @@ struct pixman_renderer {
struct wl_signal destroy_signal; struct wl_signal destroy_signal;
}; };
static pixman_image_t *
pixman_renderer_renderbuffer_get_image(weston_renderbuffer_t renderbuffer)
{
struct pixman_renderbuffer *rb =
(struct pixman_renderbuffer *) renderbuffer;
return rb->image;
}
static inline struct pixman_output_state * static inline struct pixman_output_state *
get_output_state(struct weston_output *output) get_output_state(struct weston_output *output)
{ {
@ -1241,5 +1232,4 @@ pixman_renderer_output_destroy(struct weston_output *output)
static struct pixman_renderer_interface pixman_renderer_interface = { static struct pixman_renderer_interface pixman_renderer_interface = {
.output_create = pixman_renderer_output_create, .output_create = pixman_renderer_output_create,
.output_destroy = pixman_renderer_output_destroy, .output_destroy = pixman_renderer_output_destroy,
.renderbuffer_get_image = pixman_renderer_renderbuffer_get_image,
}; };

View file

@ -46,6 +46,4 @@ struct pixman_renderer_interface {
int (*output_create)(struct weston_output *output, int (*output_create)(struct weston_output *output,
const struct pixman_renderer_output_options *options); const struct pixman_renderer_output_options *options);
void (*output_destroy)(struct weston_output *output); void (*output_destroy)(struct weston_output *output);
pixman_image_t *(*renderbuffer_get_image)(weston_renderbuffer_t renderbuffer);
}; };