Move read_pixels from output to renderer

This commit is contained in:
emersion 2017-10-08 02:11:56 +02:00
parent 55c063f440
commit 0ce3135304
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
9 changed files with 64 additions and 36 deletions

View file

@ -30,27 +30,32 @@ struct wlr_texture *wlr_render_texture_create(struct wlr_renderer *r);
* This will render the texture at <123, 321>.
*/
bool wlr_render_with_matrix(struct wlr_renderer *r,
struct wlr_texture *texture, const float (*matrix)[16]);
struct wlr_texture *texture, const float (*matrix)[16]);
/**
* Renders a solid quad in the specified color.
*/
void wlr_render_colored_quad(struct wlr_renderer *r,
const float (*color)[4], const float (*matrix)[16]);
const float (*color)[4], const float (*matrix)[16]);
/**
* Renders a solid ellipse in the specified color.
*/
void wlr_render_colored_ellipse(struct wlr_renderer *r,
const float (*color)[4], const float (*matrix)[16]);
const float (*color)[4], const float (*matrix)[16]);
/**
* Returns a list of pixel formats supported by this renderer.
*/
const enum wl_shm_format *wlr_renderer_get_formats(
struct wlr_renderer *r, size_t *len);
struct wlr_renderer *r, size_t *len);
/**
* Returns true if this wl_buffer is a DRM buffer.
*/
bool wlr_renderer_buffer_is_drm(struct wlr_renderer *renderer,
struct wl_resource *buffer);
struct wl_resource *buffer);
/**
* Reads pixels and stores them in out_data as ARGB8888.
*/
void wlr_renderer_read_pixels(struct wlr_renderer *r, int x, int y,
int width, int height, void *out_data);
/**
* Destroys this wlr_renderer. Textures must be destroyed separately.
*/

View file

@ -28,6 +28,8 @@ struct wlr_renderer_impl {
struct wlr_renderer *renderer, size_t *len);
bool (*buffer_is_drm)(struct wlr_renderer *renderer,
struct wl_resource *buffer);
void (*read_pixels)(struct wlr_renderer *renderer, int x, int y, int width,
int height, void *out_data);
void (*destroy)(struct wlr_renderer *renderer);
};

View file

@ -72,9 +72,4 @@ void wlr_output_set_gamma(struct wlr_output *output,
uint16_t size, uint16_t *r, uint16_t *g, uint16_t *b);
uint16_t wlr_output_get_gamma_size(struct wlr_output *output);
/**
* Reads all pixels from the output and stores them as ARGB.
*/
void wlr_output_read_pixels(struct wlr_output *output, void *out_data);
#endif

View file

@ -4,18 +4,23 @@
struct wlr_screenshooter {
struct wl_global *wl_global;
struct wlr_renderer *renderer;
void *data;
};
struct wlr_screenshot {
struct wl_resource *resource;
struct wl_resource *output;
struct wl_resource *output_resource;
struct wlr_output *output;
struct wlr_screenshooter *screenshooter;
void* data;
};
struct wlr_screenshooter *wlr_screenshooter_create(struct wl_display *display);
struct wlr_screenshooter *wlr_screenshooter_create(struct wl_display *display,
struct wlr_renderer *renderer);
void wlr_screenshooter_destroy(struct wlr_screenshooter *screenshooter);
#endif