refactor: break out stride calculation to new function

This commit is contained in:
Daniel Eklöf 2019-08-18 17:59:43 +02:00
parent 8aa53d1508
commit 33b5210a6a
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 13 additions and 6 deletions

9
stride.h Normal file
View file

@ -0,0 +1,9 @@
#pragma once
#include <pixman.h>
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);
}