kms/update: Add meta_fixed_16_from_double helper

It will be used in the next commit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3177>
This commit is contained in:
Robert Mader 2024-02-10 16:53:17 +01:00 committed by Marge Bot
parent d5fe58f355
commit 26ce5cd6be

View File

@ -209,6 +209,12 @@ meta_fixed_16_to_int (MetaFixed16 fixed)
return fixed / (1 << 16);
}
static inline MetaFixed16
meta_fixed_16_from_double (double d)
{
return d * (1 << 16);
}
static inline double
meta_fixed_16_to_double (MetaFixed16 fixed)
{