Align rows to 8 bits only.

This commit is contained in:
castano 2010-09-07 18:07:53 +00:00
parent 9ce42ecfa4
commit e2ac16f100

View File

@ -39,10 +39,8 @@ namespace
inline uint computePitch(uint w, uint bitsize) inline uint computePitch(uint w, uint bitsize)
{ {
uint p = w * ((bitsize + 7) / 8); // Align to 8 bits.
return w * ((bitsize + 7) / 8);
// Align to 32 bits.
return ((p + 3) / 4) * 4;
} }
inline void convert_to_a8r8g8b8(const void * src, void * dst, uint w) inline void convert_to_a8r8g8b8(const void * src, void * dst, uint w)