We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3368

Summary: SDL_Blit_Slow doesn't ignore alpha values in colorkey comparison
Product: SDL Reporter: Simon Hug <chli.hug>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: All   
OS: All   
Attachments: SDL_Blit_Slow color key test case.
Patch that adds an rgb mask to the color key comparison in the SDL_Blit_Slow function.

Description Simon Hug 2016-06-20 13:42:46 UTC
Created attachment 2502 [details]
SDL_Blit_Slow color key test case.

When the SDL_Blit_Slow function compares the pixel to the color key it does so without removing the alpha component from the pixel value and the key. This is different from the optimized 32-bit blitters which create a rgb mask and apply it to both to filter the alpha out. SDL_Blit_Slow will only skip the pixels with the exact alpha value of the key instead of all pixels with the same color.

The attached test case blits a surface with a color key and prints the pixel values to the console. The third row is expected to be skipped.
Comment 1 Simon Hug 2016-06-20 13:43:34 UTC
Created attachment 2503 [details]
Patch that adds an rgb mask to the color key comparison in the SDL_Blit_Slow function.
Comment 2 Sam Lantinga 2016-10-01 17:46:26 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/3f0d2277232c