moved shadow rendering to render_view
This commit is contained in:
parent
c2dee0740d
commit
995deba855
1 changed files with 12 additions and 23 deletions
|
@ -472,7 +472,7 @@ static void render_saved_view(struct sway_view *view, struct sway_output *output
|
|||
}
|
||||
|
||||
/**
|
||||
* Render a view's surface and left/bottom/right borders.
|
||||
* Render a view's surface, shadow, and left/bottom/right borders.
|
||||
*/
|
||||
static void render_view(struct sway_output *output, pixman_region32_t *damage,
|
||||
struct sway_container *con, struct border_colors *colors,
|
||||
|
@ -585,6 +585,17 @@ static void render_view(struct sway_output *output, pixman_region32_t *damage,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// render shadow
|
||||
if (con->shadow_enabled
|
||||
&& config->shadow_blur_sigma > 0
|
||||
&& config->shadow_color[3] > 0.0) {
|
||||
struct wlr_box box = { state->x, state->y, state->width, state->height };
|
||||
scale_box(&box, output->wlr_output->scale);
|
||||
render_box_shadow(output, damage, &box, config->shadow_color,
|
||||
config->shadow_blur_sigma, deco_data.corner_radius,
|
||||
con->current.border_thickness);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1006,17 +1017,6 @@ static void render_containers_linear(struct sway_output *output,
|
|||
} else if (state->border == B_PIXEL) {
|
||||
render_top_border(output, damage, state, colors, deco_data.alpha, deco_data.corner_radius);
|
||||
}
|
||||
|
||||
// render shadow
|
||||
if (child->shadow_enabled
|
||||
&& config->shadow_blur_sigma > 0
|
||||
&& config->shadow_color[3] > 0.0) {
|
||||
struct wlr_box box = { state->x, state->y, state->width, state->height };
|
||||
scale_box(&box, output->wlr_output->scale);
|
||||
render_box_shadow(output, damage, &box, config->shadow_color,
|
||||
config->shadow_blur_sigma, deco_data.corner_radius,
|
||||
child->current.border_thickness);
|
||||
}
|
||||
} else {
|
||||
render_container(output, damage, child,
|
||||
parent->focused || child->current.focused);
|
||||
|
@ -1286,17 +1286,6 @@ static void render_floating_container(struct sway_output *soutput,
|
|||
} else if (state->border == B_PIXEL) {
|
||||
render_top_border(soutput, damage, state, colors, deco_data.alpha, deco_data.corner_radius);
|
||||
}
|
||||
|
||||
// render shadow
|
||||
if (con->shadow_enabled
|
||||
&& config->shadow_blur_sigma > 0
|
||||
&& config->shadow_color[3] > 0.0) {
|
||||
struct wlr_box box = { state->x, state->y, state->width, state->height };
|
||||
scale_box(&box, soutput->wlr_output->scale);
|
||||
render_box_shadow(soutput, damage, &box, config->shadow_color,
|
||||
config->shadow_blur_sigma, deco_data.corner_radius,
|
||||
state->border_thickness);
|
||||
}
|
||||
} else {
|
||||
render_container(soutput, damage, con, state->focused);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue