mirror of
https://github.com/swaywm/sway.git
synced 2026-04-29 06:46:22 -04:00
output: clean up output_damage_view
Since it was only used once, its logic was moved to output_damage_from_view, and the iterator changed since the variable 'whole' is now always false. Also removed unused function output_damage_whole_container_iterator.
This commit is contained in:
parent
176832fe30
commit
8006447efa
1 changed files with 4 additions and 26 deletions
|
|
@ -392,10 +392,7 @@ void output_damage_whole(struct sway_output *output) {
|
||||||
|
|
||||||
static void damage_surface_iterator(struct sway_output *output,
|
static void damage_surface_iterator(struct sway_output *output,
|
||||||
struct wlr_surface *surface, struct wlr_box *_box, float rotation,
|
struct wlr_surface *surface, struct wlr_box *_box, float rotation,
|
||||||
void *_data) {
|
void *data) {
|
||||||
bool *data = _data;
|
|
||||||
bool whole = *data;
|
|
||||||
|
|
||||||
struct wlr_box box = *_box;
|
struct wlr_box box = *_box;
|
||||||
scale_box(&box, output->wlr_output->scale);
|
scale_box(&box, output->wlr_output->scale);
|
||||||
|
|
||||||
|
|
@ -426,11 +423,6 @@ static void damage_surface_iterator(struct sway_output *output,
|
||||||
pixman_region32_fini(&damage);
|
pixman_region32_fini(&damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (whole) {
|
|
||||||
wlr_box_rotated_bounds(&box, rotation, &box);
|
|
||||||
wlr_output_damage_add_box(output->damage, &box);
|
|
||||||
}
|
|
||||||
|
|
||||||
wlr_output_schedule_frame(output->wlr_output);
|
wlr_output_schedule_frame(output->wlr_output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -440,17 +432,12 @@ void output_damage_surface(struct sway_output *output, double ox, double oy,
|
||||||
damage_surface_iterator, &whole);
|
damage_surface_iterator, &whole);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void output_damage_view(struct sway_output *output,
|
void output_damage_from_view(struct sway_output *output,
|
||||||
struct sway_view *view, bool whole) {
|
struct sway_view *view) {
|
||||||
if (!view_is_visible(view)) {
|
if (!view_is_visible(view)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
output_view_for_each_surface(output, view, damage_surface_iterator, &whole);
|
output_view_for_each_surface(output, view, damage_surface_iterator, NULL);
|
||||||
}
|
|
||||||
|
|
||||||
void output_damage_from_view(struct sway_output *output,
|
|
||||||
struct sway_view *view) {
|
|
||||||
output_damage_view(output, view, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Expecting an unscaled box in layout coordinates
|
// Expecting an unscaled box in layout coordinates
|
||||||
|
|
@ -463,15 +450,6 @@ void output_damage_box(struct sway_output *output, struct wlr_box *_box) {
|
||||||
wlr_output_damage_add_box(output->damage, &box);
|
wlr_output_damage_add_box(output->damage, &box);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void output_damage_whole_container_iterator(struct sway_container *con,
|
|
||||||
void *data) {
|
|
||||||
if (!sway_assert(con->view, "expected a view")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
struct sway_output *output = data;
|
|
||||||
output_damage_view(output, con->view, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void output_damage_whole_container(struct sway_output *output,
|
void output_damage_whole_container(struct sway_output *output,
|
||||||
struct sway_container *con) {
|
struct sway_container *con) {
|
||||||
// Pad the box by 1px, because the width is a double and might be a fraction
|
// Pad the box by 1px, because the width is a double and might be a fraction
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue