-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use thicker lines on hiDPI displays in the editor profiler and visual profiler #99084
base: master
Are you sure you want to change the base?
Use thicker lines on hiDPI displays in the editor profiler and visual profiler #99084
Conversation
… profiler - Draw a line in the middle between the CPU and GPU graphs. - Make the target FPS line/legend styling match the one used in the Monitors tab.
22d4bc0
to
73a1def
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use a hidpi display.
if (EDSCALE > (1.5 - CMP_EPSILON)) { | ||
// Make the line thicker for hiDPI displays. | ||
column[j * 4 + 4] += Math::fast_ftoi(CLAMP(col.r * 255, 0, 255)); | ||
column[j * 4 + 5] += Math::fast_ftoi(CLAMP(col.g * 255, 0, 255)); | ||
column[j * 4 + 6] += Math::fast_ftoi(CLAMP(col.b * 255, 0, 255)); | ||
column[j * 4 + 7] += 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have additional check for j
value. Not sure if this ever happens, but seems like plot_pos
can point to the last column (h - 1
), and in this case it will go out of bounds of columns
(size h * 4
).
@@ -453,44 +453,57 @@ void EditorVisualProfiler::_graph_tex_draw() { | |||
int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label")); | |||
const Color color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor)); | |||
|
|||
const int half_width = graph->get_size().x / 2; | |||
// Draw a line in the middle to separate the CPU graph from the GPU graph. | |||
graph->draw_line(Vector2(half_width, 0), Vector2(half_width, graph->get_size().y), color * Color(1, 1, 1, 0.3), Math::round(EDSCALE)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EDSCALE
can be less than one, so can be rounded to zero if it's too small (UI clamps it to 0.5
), and seems like draw_line
will draw nothing if width is zero (bug?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Math::round(EDSCALE)
is a pattern we use a lot currently, and I don't think anyone is using an editor scale below 0.5
. The value 0.5
rounds to 1.0
anyway since round()
always rounds away from 0.0
. The smallest preset available is 0.75
, and it's the smallest value I expect to be practically usable (it was designed for 1366×768 displays which are getting uncommon).
Preview
Profiler
Visual Profiler