Debug CanvasItem redraw

I wanted to add this tool for years and always forget. This command line option:

```
$ godot.exe -e --debug-canvas-item-redraw
```

Allows to see when a canvas item is redrawn. This helps find out if something
in the UI is refreshing in a way it should not. Examples as such:

* Signals causing more of the UI to redraw.
* Container resizing causes more UI elements to redraw.
* Something using a timer is redrawing all time time, which can go unnoticed.

To my surprise, the editor UI is redrawing very efficiently. There is some
weird stuff with the scene tabs, redrawing when the inspector changes but most
things for the most part are fine.
This commit is contained in:
Juan Linietsky
2023-07-07 19:35:54 +02:00
committed by Rémi Verschelde
parent 713bfaf5ea
commit 407b16ab00
14 changed files with 124 additions and 0 deletions

View File

@ -1393,6 +1393,8 @@ public:
virtual void canvas_item_set_canvas_group_mode(RID p_item, CanvasGroupMode p_mode, float p_clear_margin = 5.0, bool p_fit_empty = false, float p_fit_margin = 0.0, bool p_blur_mipmaps = false) = 0;
virtual void canvas_item_set_debug_redraw(bool p_enabled) = 0;
/* CANVAS LIGHT */
virtual RID canvas_light_create() = 0;