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 3159

Summary: SDL_blit_slow with BLENDING does not work
Product: SDL Reporter: Fritzor <fhattendorf>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: chli.hug, philipp.wiesemann
Version: 2.0.3   
Hardware: x86_64   
OS: Linux   
Attachments: Fixes the alpha blending in SDL_blit_slow.

Description Fritzor 2015-10-27 12:17:25 UTC
Source Suface is ABGR and Destination Surface is ABGR. We use software blending. In the Switch-Case statement for SDL_COPY_BLEND (Line 126) the alpha-channel is not calculated like in every SDL_blit_auto - function. So if the destination Surface has alpha - channel of zero the resulting surface has zero as well. 
Add:  “dstA = srcA + ((255 - srcA) * dstA) / 255;” to code and everything is okay.
Comment 1 Fritzor 2015-10-27 12:18:21 UTC
I forget: The code in the SDL_blit_slow.c file is meant.
Comment 2 Simon Hug 2016-06-11 19:34:25 UTC
Created attachment 2490 [details]
Fixes the alpha blending in SDL_blit_slow.

I stumbled over the same thing. Here's a patch.
Comment 3 Sam Lantinga 2016-10-01 20:40:18 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/eeb3847d81a6