From 33b5210a6a69c04c8de7589ac8c0b86c38ce75c3 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 18 Aug 2019 17:59:43 +0200 Subject: refactor: break out stride calculation to new function --- stride.h | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 stride.h (limited to 'stride.h') diff --git a/stride.h b/stride.h new file mode 100644 index 00000000..b2c71a71 --- /dev/null +++ b/stride.h @@ -0,0 +1,9 @@ +#pragma once + +#include + +static inline int +stride_for_format_and_width(pixman_format_code_t format, int width) +{ + return (((PIXMAN_FORMAT_BPP(format) * width + 7) / 8 + 4 - 1) & -4); +} -- cgit v1.3