mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
render/pixman: add wlr_pixman_renderer_get_buffer_image()
This is similar to wlr_pixman_texture_get_image and can be useful for compositors to access the rendering data.
This commit is contained in:
parent
7ad3f4ad2d
commit
3531007b75
2 changed files with 16 additions and 0 deletions
|
@ -16,6 +16,9 @@ struct wlr_renderer *wlr_pixman_renderer_create(void);
|
||||||
|
|
||||||
bool wlr_renderer_is_pixman(struct wlr_renderer *wlr_renderer);
|
bool wlr_renderer_is_pixman(struct wlr_renderer *wlr_renderer);
|
||||||
bool wlr_texture_is_pixman(struct wlr_texture *texture);
|
bool wlr_texture_is_pixman(struct wlr_texture *texture);
|
||||||
|
|
||||||
|
pixman_image_t *wlr_pixman_renderer_get_buffer_image(
|
||||||
|
struct wlr_renderer *wlr_renderer, struct wlr_buffer *wlr_buffer);
|
||||||
pixman_image_t *wlr_pixman_texture_get_image(struct wlr_texture *wlr_texture);
|
pixman_image_t *wlr_pixman_texture_get_image(struct wlr_texture *wlr_texture);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -343,6 +343,19 @@ struct wlr_renderer *wlr_pixman_renderer_create(void) {
|
||||||
return &renderer->wlr_renderer;
|
return &renderer->wlr_renderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pixman_image_t *wlr_pixman_renderer_get_buffer_image(
|
||||||
|
struct wlr_renderer *wlr_renderer, struct wlr_buffer *wlr_buffer) {
|
||||||
|
struct wlr_pixman_renderer *renderer = get_renderer(wlr_renderer);
|
||||||
|
struct wlr_pixman_buffer *buffer = get_buffer(renderer, wlr_buffer);
|
||||||
|
if (!buffer) {
|
||||||
|
buffer = create_buffer(renderer, wlr_buffer);
|
||||||
|
}
|
||||||
|
if (!buffer) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
return buffer->image;
|
||||||
|
}
|
||||||
|
|
||||||
pixman_image_t *wlr_pixman_texture_get_image(struct wlr_texture *wlr_texture) {
|
pixman_image_t *wlr_pixman_texture_get_image(struct wlr_texture *wlr_texture) {
|
||||||
struct wlr_pixman_texture *texture = get_texture(wlr_texture);
|
struct wlr_pixman_texture *texture = get_texture(wlr_texture);
|
||||||
return texture->image;
|
return texture->image;
|
||||||
|
|
Loading…
Reference in a new issue