Merge pull request #93602 from aaronp64/inspector_latency

Improve Editor Inspector/Theme item lookup performance
This commit is contained in:
Rémi Verschelde 2024-08-22 00:10:26 +02:00
commit 091212b4f1
No known key found for this signature in database
GPG key ID: C3336907360768E1
16 changed files with 140 additions and 115 deletions

View file

@ -2912,13 +2912,13 @@ Ref<Font> FontVariation::_get_base_font_or_default() const {
}
StringName theme_name = "font";
List<StringName> theme_types;
ThemeDB::get_singleton()->get_native_type_dependencies(get_class_name(), &theme_types);
Vector<StringName> theme_types;
ThemeDB::get_singleton()->get_native_type_dependencies(get_class_name(), theme_types);
ThemeContext *global_context = ThemeDB::get_singleton()->get_default_theme_context();
List<Ref<Theme>> themes = global_context->get_themes();
Vector<Ref<Theme>> themes = global_context->get_themes();
if (Engine::get_singleton()->is_editor_hint()) {
themes.push_front(ThemeDB::get_singleton()->get_project_theme());
themes.insert(0, ThemeDB::get_singleton()->get_project_theme());
}
for (const Ref<Theme> &theme : themes) {
@ -3280,8 +3280,8 @@ Ref<Font> SystemFont::_get_base_font_or_default() const {
}
StringName theme_name = "font";
List<StringName> theme_types;
ThemeDB::get_singleton()->get_native_type_dependencies(get_class_name(), &theme_types);
Vector<StringName> theme_types;
ThemeDB::get_singleton()->get_native_type_dependencies(get_class_name(), theme_types);
ThemeContext *global_context = ThemeDB::get_singleton()->get_default_theme_context();
for (const Ref<Theme> &theme : global_context->get_themes()) {