mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-04 19:58:02 +02:00
libweston: remove weston_renderer::read_pixels
Unused. Nowdays renderers use weston_output_pull_capture_task(). Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
parent
c66d0ea09a
commit
e0066a8038
4 changed files with 0 additions and 76 deletions
|
|
@ -83,10 +83,6 @@ enum weston_renderer_border_side {
|
|||
};
|
||||
|
||||
struct weston_renderer {
|
||||
int (*read_pixels)(struct weston_output *output,
|
||||
const struct pixel_format_info *format, void *pixels,
|
||||
uint32_t x, uint32_t y,
|
||||
uint32_t width, uint32_t height);
|
||||
void (*repaint_output)(struct weston_output *output,
|
||||
pixman_region32_t *output_damage,
|
||||
weston_renderbuffer_t renderbuffer);
|
||||
|
|
|
|||
|
|
@ -36,15 +36,6 @@ struct noop_renderer {
|
|||
unsigned char seed; /* see comment in attach() */
|
||||
};
|
||||
|
||||
static int
|
||||
noop_renderer_read_pixels(struct weston_output *output,
|
||||
const struct pixel_format_info *format, void *pixels,
|
||||
uint32_t x, uint32_t y,
|
||||
uint32_t width, uint32_t height)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
noop_renderer_repaint_output(struct weston_output *output,
|
||||
pixman_region32_t *output_damage,
|
||||
|
|
@ -139,7 +130,6 @@ noop_renderer_init(struct weston_compositor *ec)
|
|||
if (renderer == NULL)
|
||||
return -1;
|
||||
|
||||
renderer->base.read_pixels = noop_renderer_read_pixels;
|
||||
renderer->base.repaint_output = noop_renderer_repaint_output;
|
||||
renderer->base.resize_output = noop_renderer_resize_output;
|
||||
renderer->base.flush_damage = noop_renderer_flush_damage;
|
||||
|
|
|
|||
|
|
@ -109,41 +109,6 @@ get_renderer(struct weston_compositor *ec)
|
|||
return (struct pixman_renderer *)ec->renderer;
|
||||
}
|
||||
|
||||
static int
|
||||
pixman_renderer_read_pixels(struct weston_output *output,
|
||||
const struct pixel_format_info *format, void *pixels,
|
||||
uint32_t x, uint32_t y,
|
||||
uint32_t width, uint32_t height)
|
||||
{
|
||||
struct pixman_output_state *po = get_output_state(output);
|
||||
pixman_image_t *out_buf;
|
||||
|
||||
if (!po->hw_buffer) {
|
||||
errno = ENODEV;
|
||||
return -1;
|
||||
}
|
||||
|
||||
out_buf = pixman_image_create_bits(format->pixman_format,
|
||||
width,
|
||||
height,
|
||||
pixels,
|
||||
(PIXMAN_FORMAT_BPP(format->pixman_format) / 8) * width);
|
||||
|
||||
pixman_image_composite32(PIXMAN_OP_SRC,
|
||||
po->hw_buffer, /* src */
|
||||
NULL /* mask */,
|
||||
out_buf, /* dest */
|
||||
x, y, /* src_x, src_y */
|
||||
0, 0, /* mask_x, mask_y */
|
||||
0, 0, /* dest_x, dest_y */
|
||||
po->fb_size.width, /* width */
|
||||
po->fb_size.height /* height */);
|
||||
|
||||
pixman_image_unref(out_buf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define D2F(v) pixman_double_to_fixed((double)v)
|
||||
|
||||
static void
|
||||
|
|
@ -1104,7 +1069,6 @@ pixman_renderer_init(struct weston_compositor *ec)
|
|||
|
||||
renderer->repaint_debug = 0;
|
||||
renderer->debug_color = NULL;
|
||||
renderer->base.read_pixels = pixman_renderer_read_pixels;
|
||||
renderer->base.repaint_output = pixman_renderer_repaint_output;
|
||||
renderer->base.resize_output = pixman_renderer_resize_output;
|
||||
renderer->base.flush_damage = pixman_renderer_flush_damage;
|
||||
|
|
|
|||
|
|
@ -3118,31 +3118,6 @@ gl_renderer_repaint_output(struct weston_output *output,
|
|||
gl_renderer_garbage_collect_programs(gr);
|
||||
}
|
||||
|
||||
static int
|
||||
gl_renderer_read_pixels(struct weston_output *output,
|
||||
const struct pixel_format_info *format, void *pixels,
|
||||
uint32_t x, uint32_t y,
|
||||
uint32_t width, uint32_t height)
|
||||
{
|
||||
struct gl_output_state *go = get_output_state(output);
|
||||
|
||||
x += go->area.x;
|
||||
y += go->fb_size.height - go->area.y - go->area.height;
|
||||
|
||||
if (format->gl_format == 0 || format->gl_type == 0)
|
||||
return -1;
|
||||
|
||||
if (use_output(output) < 0)
|
||||
return -1;
|
||||
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
glReadPixels(x, y, width, height, format->gl_format,
|
||||
format->gl_type, pixels);
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 4);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
gl_renderer_flush_damage(struct weston_paint_node *pnode)
|
||||
{
|
||||
|
|
@ -5020,7 +4995,6 @@ gl_renderer_display_create(struct weston_compositor *ec,
|
|||
if (gl_renderer_setup_egl_client_extensions(gr) < 0)
|
||||
goto fail;
|
||||
|
||||
gr->base.read_pixels = gl_renderer_read_pixels;
|
||||
gr->base.repaint_output = gl_renderer_repaint_output;
|
||||
gr->base.resize_output = gl_renderer_resize_output;
|
||||
gr->base.create_renderbuffer = gl_renderer_create_renderbuffer;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue