sw_engine: data optimization.

changed alpha channel data type to 32 bits from 8 bits,
since subsequent data operations requires 32 bits values.

this 8 bits (since channel range is up to 255) doesn't helpful
for saving memory size because it would generate additional data casting by compiler.

I compared the binary size and this patch saves about 600bytes.
This commit is contained in:
Hermet Park 2021-06-02 21:15:58 +09:00
parent 6ccebb3234
commit a8a120942e

View file

@ -279,7 +279,7 @@ static inline uint32_t COLOR_INTERPOLATE(uint32_t c1, uint32_t a1, uint32_t c2,
return (c1 |= t);
}
static inline uint8_t ALPHA_MULTIPLY(uint32_t c, uint32_t a)
static inline uint32_t ALPHA_MULTIPLY(uint32_t c, uint32_t a)
{
return ((c * a + 0xff) >> 8);
}