From cec16105cc5bbbb7743b769e65377fc91fb918b1 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 6 May 2019 14:04:54 +0200 Subject: Make sure all GraphicsBitmap scanlines are 16-byte aligned. This is a prerequisite for some optimizations. --- AK/StdLibExtras.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'AK') 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 -- cgit v1.2.3