Commit bf5b6219 authored by Stefan Agner's avatar Stefan Agner Committed by Simon Ser

screen-share: use pixman_image_composite32 instead of pixman_blt

The function pixman_blt may return false in case there is no
accelerated blit function available. In this case the remote shared
screen stays black.

This has been observed on Weston compiled for aarch64. In currrent
pixman 0.38.4 there is no accelerated pixman_blt function for
aarch64 available.

Use pixman_image_composite32 instead which is guaranteed to have a
working fallback implementation.

Fixes: #253Signed-off-by: Stefan Agner's avatarStefan Agner <>
parent ab840fc8
Pipeline #56801 passed with stages
in 1 minute and 52 seconds
......@@ -820,7 +820,8 @@ shared_output_repainted(struct wl_listener *listener, void *data)
int32_t x, y, width, height, stride;
int i, nrects, do_yflip, y_orig;
pixman_box32_t *r;
uint32_t *cache_data;
pixman_image_t *damaged_image;
pixman_transform_t transform;
width = so->output->current_mode->width;
height = so->output->current_mode->height;
......@@ -863,7 +864,6 @@ shared_output_repainted(struct wl_listener *listener, void *data)
do_yflip = !!(so->output->compositor->capabilities & WESTON_CAP_CAPTURE_YFLIP);
cache_data = pixman_image_get_data(so->cache_image);
r = pixman_region32_rectangles(&damage, &nrects);
for (i = 0; i < nrects; ++i) {
x = r[i].x1;
......@@ -880,13 +880,34 @@ shared_output_repainted(struct wl_listener *listener, void *data)
so->output, PIXMAN_a8r8g8b8, so->tmp_data,
x, y_orig, width, height);
damaged_image = pixman_image_create_bits(PIXMAN_a8r8g8b8,
width, height,
(PIXMAN_FORMAT_BPP(PIXMAN_a8r8g8b8) / 8) * width);
if (!damaged_image)
goto err_pixman_init;
if (do_yflip) {
pixman_blt(so->tmp_data, cache_data, -width, stride,
32, 32, 0, 1 - height, x, y, width, height);
} else {
pixman_blt(so->tmp_data, cache_data, width, stride,
32, 32, 0, 0, x, y, width, height);
pixman_transform_translate(&transform, NULL,
pixman_image_set_transform(damaged_image, &transform);
0, 0,
0, 0,
x, y,
width, height);
so->cache_dirty = 1;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment