From 734dda8ffcfe8a77b6e7ccd5ecbb029b81531575 Mon Sep 17 00:00:00 2001 From: Will McKinnon Date: Thu, 20 Oct 2022 21:07:42 -0400 Subject: [PATCH] style: cleaned up corner rendering function --- sway/desktop/fx_renderer.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/sway/desktop/fx_renderer.c b/sway/desktop/fx_renderer.c index 29394b76..e644eedd 100644 --- a/sway/desktop/fx_renderer.c +++ b/sway/desktop/fx_renderer.c @@ -405,26 +405,10 @@ void fx_render_border_corner(struct fx_renderer *renderer, const struct wlr_box glUniformMatrix3fv(renderer->shaders.corner.proj, 1, GL_FALSE, gl_matrix); glUniform4f(renderer->shaders.corner.color, color[0], color[1], color[2], color[3]); - glUniform1f(renderer->shaders.corner.is_top_left, false); - glUniform1f(renderer->shaders.corner.is_top_right, false); - glUniform1f(renderer->shaders.corner.is_bottom_left, false); - glUniform1f(renderer->shaders.corner.is_bottom_right, false); - switch (corner_location) { - case TOP_LEFT: - glUniform1f(renderer->shaders.corner.is_top_left, true); - break; - case TOP_RIGHT: - glUniform1f(renderer->shaders.corner.is_top_right, true); - break; - case BOTTOM_LEFT: - glUniform1f(renderer->shaders.corner.is_bottom_left, true); - break; - case BOTTOM_RIGHT: - glUniform1f(renderer->shaders.corner.is_bottom_right, true); - break; - default: - return; - } + glUniform1f(renderer->shaders.corner.is_top_left, corner_location == TOP_LEFT); + glUniform1f(renderer->shaders.corner.is_top_right, corner_location == TOP_RIGHT); + glUniform1f(renderer->shaders.corner.is_bottom_left, corner_location == BOTTOM_LEFT); + glUniform1f(renderer->shaders.corner.is_bottom_right, corner_location == BOTTOM_RIGHT); glUniform1f(renderer->shaders.corner.width, box->width); glUniform1f(renderer->shaders.corner.height, box->height);