diff options
| author | Rémi Verschelde <remi@verschelde.fr> | 2023-10-11 08:40:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-11 08:40:05 +0200 |
| commit | 4b7cc99bc195387c784efced7fdd360501d9a5cf (patch) | |
| tree | 11c43074bdef56c0f0a364e72bedf9f5a5d19032 /main | |
| parent | 918f0463540bc8fb70bc9d7843636b0c1143c4cf (diff) | |
| parent | 407b16ab000b340006b1b2b2c4c574f1b634d3a9 (diff) | |
| download | redot-engine-4b7cc99bc195387c784efced7fdd360501d9a5cf.tar.gz | |
Merge pull request #79169 from reduz/debug-canvas-item-redraw
Debug CanvasItem redraw
Diffstat (limited to 'main')
| -rw-r--r-- | main/main.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp index 9b667244b7..72a5210f12 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -213,6 +213,7 @@ static bool debug_collisions = false; static bool debug_paths = false; static bool debug_navigation = false; static bool debug_avoidance = false; +static bool debug_canvas_item_redraw = false; #endif static int max_fps = -1; static int frame_delay = 0; @@ -486,6 +487,7 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print(" --debug-navigation Show navigation polygons when running the scene.\n"); OS::get_singleton()->print(" --debug-avoidance Show navigation avoidance debug visuals when running the scene.\n"); OS::get_singleton()->print(" --debug-stringnames Print all StringName allocations to stdout when the engine quits.\n"); + OS::get_singleton()->print(" --debug-canvas-item-redraw Display a rectangle each time a canvas item requests a redraw (useful to troubleshoot low processor mode).\n"); #endif OS::get_singleton()->print(" --max-fps <fps> Set a maximum number of frames per second rendered (can be used to limit power usage). A value of 0 results in unlimited framerate.\n"); OS::get_singleton()->print(" --frame-delay <ms> Simulate high CPU load (delay each frame by <ms> milliseconds). Do not use as a FPS limiter; use --max-fps instead.\n"); @@ -1455,6 +1457,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph debug_navigation = true; } else if (I->get() == "--debug-avoidance") { debug_avoidance = true; + } else if (I->get() == "--debug-canvas-item-redraw") { + debug_canvas_item_redraw = true; } else if (I->get() == "--debug-stringnames") { StringName::set_debug_stringnames(true); #endif @@ -3107,6 +3111,9 @@ bool Main::start() { NavigationServer3D::get_singleton()->set_active(true); NavigationServer3D::get_singleton()->set_debug_enabled(true); } + if (debug_canvas_item_redraw) { + RenderingServer::get_singleton()->canvas_item_set_debug_redraw(true); + } #endif if (single_threaded_scene) { |
