|
37 | 37 | #include "editor/themes/editor_scale.h"
|
38 | 38 | #include "scene/resources/image_texture.h"
|
39 | 39 |
|
| 40 | +void EditorVisualProfiler::set_hardware_info(const String &p_cpu_name, const String &p_gpu_name) { |
| 41 | + cpu_name = p_cpu_name; |
| 42 | + gpu_name = p_gpu_name; |
| 43 | + queue_redraw(); |
| 44 | +} |
| 45 | + |
40 | 46 | void EditorVisualProfiler::add_frame_metric(const Metric &p_metric) {
|
41 | 47 | ++last_metric;
|
42 | 48 | if (last_metric >= frame_metrics.size()) {
|
@@ -489,8 +495,8 @@ void EditorVisualProfiler::_graph_tex_draw() {
|
489 | 495 | graph->draw_string(font, Vector2(half_width * 2 - font->get_string_size(limit_str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x - 2, frame_y - 2), limit_str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color * Color(1, 1, 1, 0.75));
|
490 | 496 | }
|
491 | 497 |
|
492 |
| - graph->draw_string(font, Vector2(font->get_string_size("X", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x, font->get_ascent(font_size) + 2), "CPU:", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color * Color(1, 1, 1)); |
493 |
| - graph->draw_string(font, Vector2(font->get_string_size("X", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x + graph->get_size().width / 2, font->get_ascent(font_size) + 2), "GPU:", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color * Color(1, 1, 1)); |
| 498 | + graph->draw_string(font, Vector2(font->get_string_size("X", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x, font->get_ascent(font_size) + 2), "CPU: " + cpu_name, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color * Color(1, 1, 1, 0.75)); |
| 499 | + graph->draw_string(font, Vector2(font->get_string_size("X", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x + graph->get_size().width / 2, font->get_ascent(font_size) + 2), "GPU: " + gpu_name, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color * Color(1, 1, 1, 0.75)); |
494 | 500 | }
|
495 | 501 |
|
496 | 502 | void EditorVisualProfiler::_graph_tex_mouse_exit() {
|
|
0 commit comments