| 53 | } |
| 54 | |
| 55 | void EditorVisualProfiler::add_frame_metric(const Metric &p_metric) { |
| 56 | ++last_metric; |
| 57 | if (last_metric >= frame_metrics.size()) { |
| 58 | last_metric = 0; |
| 59 | } |
| 60 | |
| 61 | frame_metrics.write[last_metric] = p_metric; |
| 62 | |
| 63 | List<String> stack; |
| 64 | for (int i = 0; i < frame_metrics[last_metric].areas.size(); i++) { |
| 65 | String name = frame_metrics[last_metric].areas[i].name; |
| 66 | frame_metrics.write[last_metric].areas.write[i].color_cache = _get_color_from_signature(name); |
| 67 | String full_name; |
| 68 | |
| 69 | if (name[0] == '<') { |
| 70 | stack.pop_back(); |
| 71 | } |
| 72 | |
| 73 | if (stack.size()) { |
| 74 | full_name = stack.back()->get() + name; |
| 75 | } else { |
| 76 | full_name = name; |
| 77 | } |
| 78 | |
| 79 | if (name[0] == '>') { |
| 80 | stack.push_back(full_name + "/"); |
| 81 | } |
| 82 | |
| 83 | frame_metrics.write[last_metric].areas.write[i].fullpath_cache = full_name; |
| 84 | } |
| 85 | |
| 86 | updating_frame = true; |
| 87 | clear_button->set_disabled(false); |
| 88 | cursor_metric_edit->set_max(frame_metrics[last_metric].frame_number); |
| 89 | cursor_metric_edit->set_min(MAX(int64_t(frame_metrics[last_metric].frame_number) - frame_metrics.size(), 0)); |
| 90 | |
| 91 | if (!seeking) { |
| 92 | cursor_metric_edit->set_value(frame_metrics[last_metric].frame_number); |
| 93 | if (hover_metric != -1) { |
| 94 | hover_metric++; |
| 95 | if (hover_metric >= frame_metrics.size()) { |
| 96 | hover_metric = 0; |
| 97 | } |
| 98 | } |
| 99 | } |
| 100 | updating_frame = false; |
| 101 | |
| 102 | if (frame_delay->is_stopped()) { |
| 103 | frame_delay->set_wait_time(0.1); |
| 104 | frame_delay->start(); |
| 105 | } |
| 106 | |
| 107 | if (plot_delay->is_stopped()) { |
| 108 | plot_delay->set_wait_time(0.1); |
| 109 | plot_delay->start(); |
| 110 | } |
| 111 | } |
| 112 |
nothing calls this directly
no test coverage detected