summaryrefslogtreecommitdiff
path: root/AK/StdLibExtras.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-05-06 14:04:54 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-05-06 14:04:54 +0200
commitcec16105cc5bbbb7743b769e65377fc91fb918b1 (patch)
tree5cc421a9003acfac6cc8c07ccb6877e2e157b4c8 /AK/StdLibExtras.h
parentfafdda8902e25e39c0e8484252a8e17271ed4538 (diff)
downloadserenity-cec16105cc5bbbb7743b769e65377fc91fb918b1.zip
Make sure all GraphicsBitmap scanlines are 16-byte aligned.
This is a prerequisite for some optimizations.
Diffstat (limited to 'AK/StdLibExtras.h')
-rw-r--r--AK/StdLibExtras.h5
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>