diff options
author | Kirill Primak <vyivel@eclair.cafe> | 2022-11-05 09:41:57 +0300 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-11-08 09:17:04 +0000 |
commit | 9fefeb69d6fc1136cfad7d690e1d7385c058fd72 (patch) | |
tree | 93efeac4c5bdb84bdce0af845248f4d30e547b82 /render/pixman | |
parent | 123a08b44833912372f77d7fefdbb2e6e3759153 (diff) |
render/pixman: apply source image cropping
Diffstat (limited to 'render/pixman')
-rw-r--r-- | render/pixman/renderer.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/render/pixman/renderer.c b/render/pixman/renderer.c index d7ed3eae..960f14a3 100644 --- a/render/pixman/renderer.c +++ b/render/pixman/renderer.c @@ -260,10 +260,11 @@ static bool pixman_render_subtexture_with_matrix( pixman_image_set_transform(texture->image, &transform); - // TODO clip properly with src_x and src_y - pixman_image_composite32(PIXMAN_OP_OVER, texture->image, mask, - buffer->image, 0, 0, 0, 0, 0, 0, renderer->width, - renderer->height); + double x = fbox->x * m[0] + fbox->y * m[1] + 1.0 * m[6]; + double y = fbox->x * m[3] + fbox->y * m[4] + 1.0 * m[7]; + + pixman_image_composite32(PIXMAN_OP_OVER, texture->image, mask, buffer->image, + x, y, 0, 0, 0, 0, renderer->width, renderer->height); if (texture->buffer != NULL) { wlr_buffer_end_data_ptr_access(texture->buffer); |