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 - SDL_Blit_Slow doesn't ignore alpha values in colorkey comparison
Summary: SDL_Blit_Slow doesn't ignore alpha values in colorkey comparison
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: All All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-20 13:42 UTC by Simon Hug
Modified: 2016-10-01 17:46 UTC (History)
0 users

See Also:


Attachments
SDL_Blit_Slow color key test case. (2.46 KB, text/x-csrc)
2016-06-20 13:42 UTC, Simon Hug
Details
Patch that adds an rgb mask to the color key comparison in the SDL_Blit_Slow function. (821 bytes, patch)
2016-06-20 13:43 UTC, Simon Hug
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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