Ignore alpha channel in freerdp_image_copy
When copying image data consider formats that only differ on use of alpha data equal. This allows using the optimized copy routine instead of the slower color conversion routine. Fixes #3616
This commit is contained in:
parent
812def37f1
commit
1c4c57821b
@ -100,6 +100,14 @@ typedef struct gdi_palette gdiPalette;
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Compare two color formats but ignore differences in alpha channel.
|
||||
*/
|
||||
static INLINE DWORD AreColorFormatsEqualNoAlpha(DWORD first, DWORD second)
|
||||
{
|
||||
const DWORD mask = ~(8 << 12);
|
||||
return (first & mask) == (second & mask);
|
||||
}
|
||||
|
||||
/* Color Space Conversions: http://msdn.microsoft.com/en-us/library/ff566496/ */
|
||||
|
||||
/***
|
||||
|
@ -438,7 +438,7 @@ BOOL freerdp_image_copy(BYTE* pDstData, DWORD DstFormat,
|
||||
srcVMultiplier = -1;
|
||||
}
|
||||
|
||||
if (SrcFormat == DstFormat)
|
||||
if (AreColorFormatsEqualNoAlpha(SrcFormat, DstFormat))
|
||||
{
|
||||
INT32 y;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user