mirror of
https://github.com/swaywm/sway.git
synced 2024-11-26 09:51:29 +00:00
Merge pull request #2093 from emersion/damage-debug
Add SWAY_DAMAGE_DEBUG
This commit is contained in:
commit
ebe0b668c9
|
@ -846,11 +846,24 @@ static void render_output(struct sway_output *output, struct timespec *when,
|
||||||
|
|
||||||
wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height);
|
wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height);
|
||||||
|
|
||||||
|
bool damage_whole_before_swap = false;
|
||||||
if (!pixman_region32_not_empty(damage)) {
|
if (!pixman_region32_not_empty(damage)) {
|
||||||
// Output isn't damaged but needs buffer swap
|
// Output isn't damaged but needs buffer swap
|
||||||
goto renderer_end;
|
goto renderer_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *damage_debug = getenv("SWAY_DAMAGE_DEBUG");
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct sway_container *workspace = output_get_active_workspace(output);
|
struct sway_container *workspace = output_get_active_workspace(output);
|
||||||
|
|
||||||
if (workspace->sway_workspace->fullscreen) {
|
if (workspace->sway_workspace->fullscreen) {
|
||||||
|
@ -905,6 +918,12 @@ renderer_end:
|
||||||
wlr_output->transform_matrix, 0, 0, 1);
|
wlr_output->transform_matrix, 0, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (damage_whole_before_swap || root_container.sway_root->debug_tree) {
|
||||||
|
int width, height;
|
||||||
|
wlr_output_transformed_resolution(wlr_output, &width, &height);
|
||||||
|
pixman_region32_union_rect(damage, damage, 0, 0, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
wlr_renderer_scissor(renderer, NULL);
|
wlr_renderer_scissor(renderer, NULL);
|
||||||
wlr_renderer_end(renderer);
|
wlr_renderer_end(renderer);
|
||||||
if (!wlr_output_damage_swap_buffers(output->damage, when, damage)) {
|
if (!wlr_output_damage_swap_buffers(output->damage, when, damage)) {
|
||||||
|
|
Loading…
Reference in a new issue