Skip to content

Commit

Permalink
Merge branch 'yshui:next' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
pijulius authored Oct 18, 2024
2 parents 71790ff + c9e29f2 commit 52db5d7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/backend/backend_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ xcb_image_t *make_shadow(struct x_connection *c, const conv *kernel, double opac
*/
bool build_shadow(struct x_connection *c, double opacity, const int width,
const int height, const conv *kernel, xcb_render_picture_t shadow_pixel,
xcb_pixmap_t *pixmap, xcb_render_picture_t *pict) {
xcb_pixmap_t *pixmap) {
xcb_image_t *shadow_image = NULL;
xcb_pixmap_t shadow_pixmap = XCB_NONE, shadow_pixmap_argb = XCB_NONE;
xcb_render_picture_t shadow_picture = XCB_NONE, shadow_picture_argb = XCB_NONE;
Expand Down Expand Up @@ -262,12 +262,12 @@ bool build_shadow(struct x_connection *c, double opacity, const int width,
shadow_image->height);

*pixmap = shadow_pixmap_argb;
*pict = shadow_picture_argb;

xcb_free_gc(c->c, gc);
xcb_image_destroy(shadow_image);
xcb_free_pixmap(c->c, shadow_pixmap);
x_free_picture(c, shadow_picture);
x_free_picture(c, shadow_picture_argb);

return true;

Expand Down
3 changes: 1 addition & 2 deletions src/backend/backend_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ struct dual_kawase_params {
xcb_image_t *make_shadow(struct x_connection *c, const conv *kernel, double opacity,
int width, int height);
bool build_shadow(struct x_connection *, double opacity, int width, int height,
const conv *kernel, xcb_render_picture_t shadow_pixel,
xcb_pixmap_t *pixmap, xcb_render_picture_t *pict);
const conv *kernel, xcb_render_picture_t shadow_pixel, xcb_pixmap_t *pixmap);

xcb_render_picture_t
solid_picture(struct x_connection *, bool argb, double a, double r, double g, double b);
Expand Down
4 changes: 1 addition & 3 deletions src/renderer/renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,8 @@ static bool
renderer_bind_shadow(struct renderer *r, struct backend_base *backend, struct win *w) {
if (backend->ops.quirks(backend) & BACKEND_QUIRK_SLOW_BLUR) {
xcb_pixmap_t shadow = XCB_NONE;
xcb_render_picture_t pict = XCB_NONE;

if (!build_shadow(backend->c, r->shadow_color.alpha, w->widthb, w->heightb,
(void *)r->shadow_kernel, r->shadow_pixel, &shadow, &pict)) {
(void *)r->shadow_kernel, r->shadow_pixel, &shadow)) {
return false;
}

Expand Down

0 comments on commit 52db5d7

Please sign in to comment.