diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-05-06 14:04:54 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-05-06 14:04:54 +0200 |
commit | cec16105cc5bbbb7743b769e65377fc91fb918b1 (patch) | |
tree | 5cc421a9003acfac6cc8c07ccb6877e2e157b4c8 /AK | |
parent | fafdda8902e25e39c0e8484252a8e17271ed4538 (diff) | |
download | serenity-cec16105cc5bbbb7743b769e65377fc91fb918b1.zip |
Make sure all GraphicsBitmap scanlines are 16-byte aligned.
This is a prerequisite for some optimizations.
Diffstat (limited to 'AK')
-rw-r--r-- | AK/StdLibExtras.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/AK/StdLibExtras.h b/AK/StdLibExtras.h index 6a282b98ab..d090ad861d 100644 --- a/AK/StdLibExtras.h +++ b/AK/StdLibExtras.h @@ -41,6 +41,11 @@ extern "C" void* mmx_memcpy(void* to, const void* from, size_t); ); } +inline constexpr dword round_up_to_power_of_two(dword value, dword power_of_two) +{ + return ((value - 1) & ~ (power_of_two - 1)) + power_of_two; +} + namespace AK { template<typename T> |