Skip to content

Commit

Permalink
backend/gl: fix rendering windows with borders
Browse files Browse the repository at this point in the history
Don't set border_width if it's larger than corner_radius. We did check
for this, but passed the wrong variable into uniform.

Signed-off-by: Yuxuan Shui <[email protected]>
  • Loading branch information
yshui committed Apr 18, 2024
1 parent 639fba0 commit f19920a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/backend/backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ struct backend_blit_args {
int ewidth, eheight;
/// Border width of the source image. This is used with
/// `corner_radius` to create a border for the rounded corners.
/// Setting this has no effect if `corner_radius` is 0.
int border_width;
/// Whether the source image should be inverted.
bool color_inverted;
Expand Down
2 changes: 1 addition & 1 deletion src/backend/gl/gl_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ static int gl_lower_blit_args(struct gl_data *gd, struct coord origin,
.tu = {brightness, gd->samplers[GL_SAMPLER_EDGE]}},
[UNIFORM_MAX_BRIGHTNESS_LOC] = {.type = GL_FLOAT, .f = (float)args->max_brightness},
[UNIFORM_CORNER_RADIUS_LOC] = {.type = GL_FLOAT, .f = (float)args->corner_radius},
[UNIFORM_BORDER_WIDTH_LOC] = {.type = GL_FLOAT, .f = (float)args->border_width},
[UNIFORM_BORDER_WIDTH_LOC] = {.type = GL_FLOAT, .f = (float)border_width},
[UNIFORM_MASK_TEX_LOC] = {.type = GL_TEXTURE_2D,
.tu = {mask_texture, mask_sampler}},
[UNIFORM_MASK_OFFSET_LOC] = {.type = GL_FLOAT_VEC2, .f2 = {0.0F, 0.0F}},
Expand Down

0 comments on commit f19920a

Please sign in to comment.