diff options
Diffstat (limited to 'src/backend/dummy/dummy.c')
| -rw-r--r-- | src/backend/dummy/dummy.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/backend/dummy/dummy.c b/src/backend/dummy/dummy.c index a057b97..7e06fac 100644 --- a/src/backend/dummy/dummy.c +++ b/src/backend/dummy/dummy.c @@ -23,6 +23,8 @@ struct dummy_image { struct dummy_data { struct backend_base base; struct dummy_image *images; + + struct backend_image mask; }; struct backend_base *dummy_init(struct session *ps attr_unused) { @@ -47,6 +49,9 @@ void dummy_deinit(struct backend_base *data) { static void dummy_check_image(struct backend_base *base, const struct dummy_image *img) { auto dummy = (struct dummy_data *)base; + if (img == (struct dummy_image *)&dummy->mask) { + return; + } struct dummy_image *tmp = NULL; HASH_FIND_INT(dummy->images, &img->pixmap, tmp); if (!tmp) { @@ -56,10 +61,13 @@ static void dummy_check_image(struct backend_base *base, const struct dummy_imag assert(*tmp->refcount > 0); } -void dummy_compose(struct backend_base *base, void *image, int dst_x1 attr_unused, - int dst_y1 attr_unused, int dst_x2 attr_unused, int dst_y2 attr_unused, - const region_t *reg_paint attr_unused, const region_t *reg_visible attr_unused) { +void dummy_compose(struct backend_base *base, void *image, coord_t dst attr_unused, + void *mask attr_unused, coord_t mask_dst attr_unused, + const region_t *reg_paint attr_unused, + const region_t *reg_visible attr_unused) { + auto dummy attr_unused = (struct dummy_data *)base; dummy_check_image(base, image); + assert(mask == NULL || mask == &dummy->mask); } void dummy_fill(struct backend_base *backend_data attr_unused, struct color c attr_unused, @@ -67,7 +75,8 @@ void dummy_fill(struct backend_base *backend_data attr_unused, struct color c at } bool dummy_blur(struct backend_base *backend_data attr_unused, double opacity attr_unused, - void *blur_ctx attr_unused, const region_t *reg_blur attr_unused, + void *blur_ctx attr_unused, void *mask attr_unused, + coord_t mask_dst attr_unused, const region_t *reg_blur attr_unused, const region_t *reg_visible attr_unused) { return true; } @@ -94,6 +103,9 @@ void *dummy_bind_pixmap(struct backend_base *base, xcb_pixmap_t pixmap, void dummy_release_image(backend_t *base, void *image) { auto dummy = (struct dummy_data *)base; + if (image == &dummy->mask) { + return; + } auto img = (struct dummy_image *)image; assert(*img->refcount > 0); (*img->refcount)--; @@ -121,6 +133,11 @@ bool dummy_image_op(struct backend_base *base, enum image_operations op attr_unu return true; } +void *dummy_make_mask(struct backend_base *base, geometry_t size attr_unused, + const region_t *reg attr_unused) { + return &(((struct dummy_data *)base)->mask); +} + bool dummy_set_image_property(struct backend_base *base, enum image_properties prop attr_unused, void *image, void *arg attr_unused) { dummy_check_image(base, image); @@ -158,7 +175,10 @@ struct backend_operations dummy_ops = { .fill = dummy_fill, .blur = dummy_blur, .bind_pixmap = dummy_bind_pixmap, + .create_shadow_context = default_create_shadow_context, + .destroy_shadow_context = default_destroy_shadow_context, .render_shadow = default_backend_render_shadow, + .make_mask = dummy_make_mask, .release_image = dummy_release_image, .is_image_transparent = dummy_is_image_transparent, .buffer_age = dummy_buffer_age, |