mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 19:57:45 +03:00
LibGfx: Add ALWAYS_INLINE
to Color::mixed_with()/interpolate()
I can see small speedup of about 6-7% with this for some gradient painting, though Tim has been able to see an ~30% speedup in some resizing cases so this seems like a worthwhile change. Co-authored-by: Tim Ledbetter <timledbetter@gmail.com>
This commit is contained in:
parent
3cc074c1b0
commit
6ceb185865
Notes:
sideshowbarker
2024-07-17 00:07:09 +09:00
Author: https://github.com/MacDue Commit: https://github.com/SerenityOS/serenity/commit/6ceb185865 Pull-request: https://github.com/SerenityOS/serenity/pull/17509 Reviewed-by: https://github.com/gmta
@ -237,7 +237,7 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
Color mixed_with(Color other, float weight) const
|
||||
ALWAYS_INLINE Color mixed_with(Color other, float weight) const
|
||||
{
|
||||
if (alpha() == other.alpha() || with_alpha(0) == other.with_alpha(0))
|
||||
return interpolate(other, weight);
|
||||
@ -255,7 +255,7 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
Color interpolate(Color other, float weight) const noexcept
|
||||
ALWAYS_INLINE Color interpolate(Color other, float weight) const noexcept
|
||||
{
|
||||
return Gfx::Color {
|
||||
round_to<u8>(mix<float>(red(), other.red(), weight)),
|
||||
|
Loading…
Reference in New Issue
Block a user