Merge pull request #79169 from reduz/debug-canvas-item-redraw

Debug CanvasItem redraw
This commit is contained in:
Rémi Verschelde
2023-10-11 08:40:05 +02:00
committed by GitHub
14 changed files with 124 additions and 0 deletions

View File

@@ -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) {