aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/render.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-18 16:58:50 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-19 16:17:24 +1000
commit8d1dd038233cf946b36813c4c8508c17f4cda0fc (patch)
treee672976231d33467da6c8a03633c604eb0c8deb8 /sway/desktop/render.c
parentMerge pull request #2453 from ianyfan/commands (diff)
downloadsway-8d1dd038233cf946b36813c4c8508c17f4cda0fc.tar.gz
sway-8d1dd038233cf946b36813c4c8508c17f4cda0fc.tar.zst
sway-8d1dd038233cf946b36813c4c8508c17f4cda0fc.zip
Standardise debug variables
This makes all debug options stored in a single struct rather than in various places, changes/fixes the behaviour of existing options, and introduces some new options. * Fixes damage issues with `-Drender-tree` texture (by removing scissor) * Offsets the render tree overlay's `y` position for those who have swaybar at the top * Replaces `-Ddamage=rerender` with `-Dnodamage` * Replaces `-Ddamage=highlight` with `-Dhighlight-damage` * Replaces `-Dtxn-debug` with `-Dtxn-wait` * Introduces `-Dnoatomic` * Removes the `create_time` and `ms_arranging` figures from transactions and the log message. Transactions are created after arranging and the create time is of no significance. * Fixes `-Dtxn-debug` (now `-Dtxn-wait`) not working.
Diffstat (limited to 'sway/desktop/render.c')
-rw-r--r--sway/desktop/render.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index 7c48d0d2..8fc642a6 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -816,8 +816,6 @@ static void render_floating(struct sway_output *soutput,
816 } 816 }
817} 817}
818 818
819const char *damage_debug = NULL;
820
821void output_render(struct sway_output *output, struct timespec *when, 819void output_render(struct sway_output *output, struct timespec *when,
822 pixman_region32_t *damage) { 820 pixman_region32_t *damage) {
823 struct wlr_output *wlr_output = output->wlr_output; 821 struct wlr_output *wlr_output = output->wlr_output;
@@ -831,21 +829,17 @@ void output_render(struct sway_output *output, struct timespec *when,
831 829
832 wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height); 830 wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height);
833 831
834 bool damage_whole_before_swap = false;
835 if (!pixman_region32_not_empty(damage)) { 832 if (!pixman_region32_not_empty(damage)) {
836 // Output isn't damaged but needs buffer swap 833 // Output isn't damaged but needs buffer swap
837 goto renderer_end; 834 goto renderer_end;
838 } 835 }
839 836
840 if (damage_debug != NULL) { 837 if (debug.highlight_damage) {
841 if (strcmp(damage_debug, "highlight") == 0) { 838 wlr_renderer_clear(renderer, (float[]){1, 1, 0, 1});
842 wlr_renderer_clear(renderer, (float[]){1, 1, 0, 1}); 839 } else if (debug.nodamage) {
843 damage_whole_before_swap = true; 840 int width, height;
844 } else if (strcmp(damage_debug, "rerender") == 0) { 841 wlr_output_transformed_resolution(wlr_output, &width, &height);
845 int width, height; 842 pixman_region32_union_rect(damage, damage, 0, 0, width, height);
846 wlr_output_transformed_resolution(wlr_output, &width, &height);
847 pixman_region32_union_rect(damage, damage, 0, 0, width, height);
848 }
849 } 843 }
850 844
851 struct sway_container *workspace = output_get_active_workspace(output); 845 struct sway_container *workspace = output_get_active_workspace(output);
@@ -919,12 +913,12 @@ render_overlay:
919 render_drag_icons(output, damage, &root_container.sway_root->drag_icons); 913 render_drag_icons(output, damage, &root_container.sway_root->drag_icons);
920 914
921renderer_end: 915renderer_end:
922 if (root_container.sway_root->debug_tree) { 916 if (debug.render_tree) {
917 wlr_renderer_scissor(renderer, NULL);
923 wlr_render_texture(renderer, root_container.sway_root->debug_tree, 918 wlr_render_texture(renderer, root_container.sway_root->debug_tree,
924 wlr_output->transform_matrix, 0, 0, 1); 919 wlr_output->transform_matrix, 0, 40, 1);
925 } 920 }
926 921 if (debug.highlight_damage) {
927 if (damage_whole_before_swap || root_container.sway_root->debug_tree) {
928 int width, height; 922 int width, height;
929 wlr_output_transformed_resolution(wlr_output, &width, &height); 923 wlr_output_transformed_resolution(wlr_output, &width, &height);
930 pixman_region32_union_rect(damage, damage, 0, 0, width, height); 924 pixman_region32_union_rect(damage, damage, 0, 0, width, height);