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 843

Summary: Wrong blitting in testalpha test
Product: SDL Reporter: Mike Gorchak <mike>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2    
Version: HG 2.0   
Hardware: All   
OS: All   
Attachments: Screenshot of the issue

Description Mike Gorchak 2009-10-12 09:45:09 UTC
Created attachment 415 [details]
Screenshot of the issue

1) If you run testalpha test in 24 bpp (./testalpha -bpp 24) mode, you'll see
sometimes (when alpha value slides up/down and becoming 255 again) that masking
is not working. How to reproduce: run in 24 bpp mode (using other color depth
modes this bug is not reproducible), and wait while "smile" sprite opacity is
sliding. See the attached screenshot.

2) When testalpha is running in 24 bpp mode, press right mouse button and test
will be terminated due to segfault in SDL software blit internals (the test
tries to fill black rectangle at mouse cursor position).

3) Run this test in 32 bpp mode (./testalpha -bpp 32) and "smile"'s opacity is
not sliding (sticked at minimum alpha value), but all works fine in 15/16/24
bpp modes.
Comment 1 Ryan C. Gordon 2009-12-15 00:02:41 UTC
Tossing bug to Sam.

--ryan.
Comment 2 Sam Lantinga 2009-12-16 22:06:02 UTC
1) This was a bug in the slow blitter, fixed in revision 5423.  Thanks!

2) I wasn't able to reproduce this.  Is it still happening in the current snapshot?

3) This isn't technically a bug, though I'm wondering if the behavior should be changed.  See the note in SDL_SetAlpha() in SDL_compat.c:
751	        /* According to the docs, value is ignored for alpha surfaces */
752	        if (surface->format->Amask) {
753	            value = 0xFF;
754	        }