mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 01:50:42 -05:00
cogl-texture: Avoid premult conversion if the dst format has no alpha
The _cogl_texture_needs_premult_conversion function was already checking whether the source format had an alpha channel before returning TRUE, but it also doesn't make sense to do the premult conversion if the destination format has no alpha. This patch adds that check in too.
This commit is contained in:
parent
31b5beb2c0
commit
6ad668c76b
@ -125,8 +125,9 @@ static gboolean
|
||||
_cogl_texture_needs_premult_conversion (CoglPixelFormat src_format,
|
||||
CoglPixelFormat dst_format)
|
||||
{
|
||||
return ((src_format & COGL_A_BIT) &&
|
||||
return ((src_format & dst_format & COGL_A_BIT) &&
|
||||
src_format != COGL_PIXEL_FORMAT_A_8 &&
|
||||
dst_format != COGL_PIXEL_FORMAT_A_8 &&
|
||||
(src_format & COGL_PREMULT_BIT) !=
|
||||
(dst_format & COGL_PREMULT_BIT));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user