mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWeb: Add fast path to calculate invalidations for animated css props
- Compare only the animated properties - Clone only the hash map containing animated properties, instead of the entire StyleProperties. Reduces `KeyframeEffect::update_style_properties()` from 10% to 3% in GitHub profiles.
This commit is contained in:
parent
ce2bfb4a12
commit
cf7c933312
Notes:
sideshowbarker
2024-07-16 22:16:50 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: cf7c933312
Pull-request: https://github.com/SerenityOS/serenity/pull/23635
Reviewed-by: https://github.com/awesomekling
9 changed files with 132 additions and 84 deletions
|
@ -23,8 +23,6 @@ public:
|
|||
|
||||
static NonnullRefPtr<StyleProperties> create() { return adopt_ref(*new StyleProperties); }
|
||||
|
||||
NonnullRefPtr<StyleProperties> clone() const;
|
||||
|
||||
template<typename Callback>
|
||||
inline void for_each_property(Callback callback) const
|
||||
{
|
||||
|
@ -55,6 +53,7 @@ public:
|
|||
auto& properties() { return m_property_values; }
|
||||
auto const& properties() const { return m_property_values; }
|
||||
|
||||
HashMap<CSS::PropertyID, NonnullRefPtr<StyleValue const>> const& animated_property_values() const { return m_animated_property_values; }
|
||||
void reset_animated_properties();
|
||||
|
||||
bool is_property_important(CSS::PropertyID property_id) const;
|
||||
|
@ -182,6 +181,8 @@ public:
|
|||
|
||||
static NonnullRefPtr<Gfx::Font const> font_fallback(bool monospace, bool bold);
|
||||
|
||||
static float resolve_opacity_value(CSS::StyleValue const& value);
|
||||
|
||||
private:
|
||||
friend class StyleComputer;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue