mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-02-28 01:41:07 -05:00
render: Add region of interest to wlr_texture_read_pixels_options
This adds a region of interest option, outside of which data need not be copied.
This commit is contained in:
parent
341154a5f6
commit
55e794203a
3 changed files with 19 additions and 2 deletions
|
|
@ -107,9 +107,12 @@ static bool texture_read_pixels(struct wlr_texture *wlr_texture,
|
|||
pixman_image_t *dst = pixman_image_create_bits_no_clear(fmt,
|
||||
src.width, src.height, p, options->stride);
|
||||
|
||||
if (options->roi) {
|
||||
pixman_image_set_clip_region32(dst, options->roi);
|
||||
}
|
||||
|
||||
pixman_image_composite32(PIXMAN_OP_SRC, texture->image, NULL, dst,
|
||||
src.x, src.y, 0, 0, 0, 0, src.width, src.height);
|
||||
|
||||
pixman_image_unref(dst);
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue