mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Merge pull request #93602 from aaronp64/inspector_latency
Improve Editor Inspector/Theme item lookup performance
This commit is contained in:
commit
091212b4f1
16 changed files with 140 additions and 115 deletions
|
|
@ -2149,8 +2149,8 @@ Ref<Texture2D> Window::get_theme_icon(const StringName &p_name, const StringName
|
|||
return theme_icon_cache[p_theme_type][p_name];
|
||||
}
|
||||
|
||||
List<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, &theme_types);
|
||||
Vector<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, theme_types);
|
||||
Ref<Texture2D> icon = theme_owner->get_theme_item_in_types(Theme::DATA_TYPE_ICON, p_name, theme_types);
|
||||
theme_icon_cache[p_theme_type][p_name] = icon;
|
||||
return icon;
|
||||
|
|
@ -2173,8 +2173,8 @@ Ref<StyleBox> Window::get_theme_stylebox(const StringName &p_name, const StringN
|
|||
return theme_style_cache[p_theme_type][p_name];
|
||||
}
|
||||
|
||||
List<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, &theme_types);
|
||||
Vector<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, theme_types);
|
||||
Ref<StyleBox> style = theme_owner->get_theme_item_in_types(Theme::DATA_TYPE_STYLEBOX, p_name, theme_types);
|
||||
theme_style_cache[p_theme_type][p_name] = style;
|
||||
return style;
|
||||
|
|
@ -2197,8 +2197,8 @@ Ref<Font> Window::get_theme_font(const StringName &p_name, const StringName &p_t
|
|||
return theme_font_cache[p_theme_type][p_name];
|
||||
}
|
||||
|
||||
List<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, &theme_types);
|
||||
Vector<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, theme_types);
|
||||
Ref<Font> font = theme_owner->get_theme_item_in_types(Theme::DATA_TYPE_FONT, p_name, theme_types);
|
||||
theme_font_cache[p_theme_type][p_name] = font;
|
||||
return font;
|
||||
|
|
@ -2221,8 +2221,8 @@ int Window::get_theme_font_size(const StringName &p_name, const StringName &p_th
|
|||
return theme_font_size_cache[p_theme_type][p_name];
|
||||
}
|
||||
|
||||
List<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, &theme_types);
|
||||
Vector<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, theme_types);
|
||||
int font_size = theme_owner->get_theme_item_in_types(Theme::DATA_TYPE_FONT_SIZE, p_name, theme_types);
|
||||
theme_font_size_cache[p_theme_type][p_name] = font_size;
|
||||
return font_size;
|
||||
|
|
@ -2245,8 +2245,8 @@ Color Window::get_theme_color(const StringName &p_name, const StringName &p_them
|
|||
return theme_color_cache[p_theme_type][p_name];
|
||||
}
|
||||
|
||||
List<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, &theme_types);
|
||||
Vector<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, theme_types);
|
||||
Color color = theme_owner->get_theme_item_in_types(Theme::DATA_TYPE_COLOR, p_name, theme_types);
|
||||
theme_color_cache[p_theme_type][p_name] = color;
|
||||
return color;
|
||||
|
|
@ -2269,8 +2269,8 @@ int Window::get_theme_constant(const StringName &p_name, const StringName &p_the
|
|||
return theme_constant_cache[p_theme_type][p_name];
|
||||
}
|
||||
|
||||
List<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, &theme_types);
|
||||
Vector<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, theme_types);
|
||||
int constant = theme_owner->get_theme_item_in_types(Theme::DATA_TYPE_CONSTANT, p_name, theme_types);
|
||||
theme_constant_cache[p_theme_type][p_name] = constant;
|
||||
return constant;
|
||||
|
|
@ -2315,8 +2315,8 @@ bool Window::has_theme_icon(const StringName &p_name, const StringName &p_theme_
|
|||
}
|
||||
}
|
||||
|
||||
List<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, &theme_types);
|
||||
Vector<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, theme_types);
|
||||
return theme_owner->has_theme_item_in_types(Theme::DATA_TYPE_ICON, p_name, theme_types);
|
||||
}
|
||||
|
||||
|
|
@ -2332,8 +2332,8 @@ bool Window::has_theme_stylebox(const StringName &p_name, const StringName &p_th
|
|||
}
|
||||
}
|
||||
|
||||
List<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, &theme_types);
|
||||
Vector<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, theme_types);
|
||||
return theme_owner->has_theme_item_in_types(Theme::DATA_TYPE_STYLEBOX, p_name, theme_types);
|
||||
}
|
||||
|
||||
|
|
@ -2349,8 +2349,8 @@ bool Window::has_theme_font(const StringName &p_name, const StringName &p_theme_
|
|||
}
|
||||
}
|
||||
|
||||
List<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, &theme_types);
|
||||
Vector<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, theme_types);
|
||||
return theme_owner->has_theme_item_in_types(Theme::DATA_TYPE_FONT, p_name, theme_types);
|
||||
}
|
||||
|
||||
|
|
@ -2366,8 +2366,8 @@ bool Window::has_theme_font_size(const StringName &p_name, const StringName &p_t
|
|||
}
|
||||
}
|
||||
|
||||
List<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, &theme_types);
|
||||
Vector<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, theme_types);
|
||||
return theme_owner->has_theme_item_in_types(Theme::DATA_TYPE_FONT_SIZE, p_name, theme_types);
|
||||
}
|
||||
|
||||
|
|
@ -2383,8 +2383,8 @@ bool Window::has_theme_color(const StringName &p_name, const StringName &p_theme
|
|||
}
|
||||
}
|
||||
|
||||
List<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, &theme_types);
|
||||
Vector<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, theme_types);
|
||||
return theme_owner->has_theme_item_in_types(Theme::DATA_TYPE_COLOR, p_name, theme_types);
|
||||
}
|
||||
|
||||
|
|
@ -2400,8 +2400,8 @@ bool Window::has_theme_constant(const StringName &p_name, const StringName &p_th
|
|||
}
|
||||
}
|
||||
|
||||
List<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, &theme_types);
|
||||
Vector<StringName> theme_types;
|
||||
theme_owner->get_theme_type_dependencies(this, p_theme_type, theme_types);
|
||||
return theme_owner->has_theme_item_in_types(Theme::DATA_TYPE_CONSTANT, p_name, theme_types);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue