mirror of
https://github.com/swaywm/sway.git
synced 2025-11-11 13:29:51 -05:00
Merge pull request #2478 from RyanDwyer/standardise-debug
Standardise debug variables
This commit is contained in:
commit
9f913614ca
7 changed files with 69 additions and 81 deletions
|
|
@ -813,8 +813,6 @@ static void render_floating(struct sway_output *soutput,
|
|||
}
|
||||
}
|
||||
|
||||
const char *damage_debug = NULL;
|
||||
|
||||
void output_render(struct sway_output *output, struct timespec *when,
|
||||
pixman_region32_t *damage) {
|
||||
struct wlr_output *wlr_output = output->wlr_output;
|
||||
|
|
@ -828,21 +826,17 @@ void output_render(struct sway_output *output, struct timespec *when,
|
|||
|
||||
wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height);
|
||||
|
||||
bool damage_whole_before_swap = false;
|
||||
if (!pixman_region32_not_empty(damage)) {
|
||||
// Output isn't damaged but needs buffer swap
|
||||
goto renderer_end;
|
||||
}
|
||||
|
||||
if (damage_debug != NULL) {
|
||||
if (strcmp(damage_debug, "highlight") == 0) {
|
||||
wlr_renderer_clear(renderer, (float[]){1, 1, 0, 1});
|
||||
damage_whole_before_swap = true;
|
||||
} else if (strcmp(damage_debug, "rerender") == 0) {
|
||||
int width, height;
|
||||
wlr_output_transformed_resolution(wlr_output, &width, &height);
|
||||
pixman_region32_union_rect(damage, damage, 0, 0, width, height);
|
||||
}
|
||||
if (debug.damage == DAMAGE_HIGHLIGHT) {
|
||||
wlr_renderer_clear(renderer, (float[]){1, 1, 0, 1});
|
||||
} else if (debug.damage == DAMAGE_RERENDER) {
|
||||
int width, height;
|
||||
wlr_output_transformed_resolution(wlr_output, &width, &height);
|
||||
pixman_region32_union_rect(damage, damage, 0, 0, width, height);
|
||||
}
|
||||
|
||||
struct sway_container *workspace = output_get_active_workspace(output);
|
||||
|
|
@ -916,12 +910,12 @@ render_overlay:
|
|||
render_drag_icons(output, damage, &root_container.sway_root->drag_icons);
|
||||
|
||||
renderer_end:
|
||||
if (root_container.sway_root->debug_tree) {
|
||||
if (debug.render_tree) {
|
||||
wlr_renderer_scissor(renderer, NULL);
|
||||
wlr_render_texture(renderer, root_container.sway_root->debug_tree,
|
||||
wlr_output->transform_matrix, 0, 0, 1);
|
||||
wlr_output->transform_matrix, 0, 40, 1);
|
||||
}
|
||||
|
||||
if (damage_whole_before_swap || root_container.sway_root->debug_tree) {
|
||||
if (debug.damage == DAMAGE_HIGHLIGHT) {
|
||||
int width, height;
|
||||
wlr_output_transformed_resolution(wlr_output, &width, &height);
|
||||
pixman_region32_union_rect(damage, damage, 0, 0, width, height);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue