diff options
author | aaronp64 <aaronp.code@gmail.com> | 2024-06-24 10:09:20 -0400 |
---|---|---|
committer | aaronp64 <aaronp.code@gmail.com> | 2024-08-20 13:39:40 -0400 |
commit | 7593e55527177d0dfb5ad536330b50e272bd93d4 (patch) | |
tree | 409a1b5f9ac9c58040e3e5261df1f7bc14234dd1 /scene/theme/theme_owner.h | |
parent | 6b281c0c07b07f2142b1fc8a6b3158091a9b124c (diff) | |
download | redot-engine-7593e55527177d0dfb5ad536330b50e272bd93d4.tar.gz |
Improve Editor Inspector/Theme item lookup performance
Changes to reduce the latency between changing node selection in the editor and seeing the new node reflected in the Inspector tab
- Use Vector instead of List for ThemeOwner::get_theme_type_dependencies and related functions
- Use Vector instead of List for ThemeContext::themes, set_themes(), and get_themes()
- Add ClassDB:get_inheritance_chain_nocheck to get all parent/ancestor classes at once, to avoid repeated ClassDB locking overhead
- Update BIND_THEME_ITEM macros and ThemeDB::update_class_instance_items to use provided StringNames for call to ThemeItemSetter, instead of creating a new StringName in each call
These changes reduce the time taken by EditorInspector::update_tree by around 30-35%
Diffstat (limited to 'scene/theme/theme_owner.h')
-rw-r--r-- | scene/theme/theme_owner.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/theme/theme_owner.h b/scene/theme/theme_owner.h index 7e19279c2a..14bfa35587 100644 --- a/scene/theme/theme_owner.h +++ b/scene/theme/theme_owner.h @@ -69,10 +69,10 @@ public: // Theme lookup. - void get_theme_type_dependencies(const Node *p_for_node, const StringName &p_theme_type, List<StringName> *r_list) const; + void get_theme_type_dependencies(const Node *p_for_node, const StringName &p_theme_type, Vector<StringName> &r_result) const; - Variant get_theme_item_in_types(Theme::DataType p_data_type, const StringName &p_name, const List<StringName> &p_theme_types); - bool has_theme_item_in_types(Theme::DataType p_data_type, const StringName &p_name, const List<StringName> &p_theme_types); + Variant get_theme_item_in_types(Theme::DataType p_data_type, const StringName &p_name, const Vector<StringName> &p_theme_types); + bool has_theme_item_in_types(Theme::DataType p_data_type, const StringName &p_name, const Vector<StringName> &p_theme_types); float get_theme_default_base_scale(); Ref<Font> get_theme_default_font(); |