mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-28 09:05:52 +00:00
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:
parent
6ccebb3234
commit
a8a120942e
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue