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 - SDL_blit_slow with BLENDING does not work
Summary: SDL_blit_slow with BLENDING does not work
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.3
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-27 12:17 UTC by Fritzor
Modified: 2016-10-01 20:40 UTC (History)
2 users (show)

See Also:


Attachments
Fixes the alpha blending in SDL_blit_slow. (526 bytes, patch)
2016-06-11 19:34 UTC, Simon Hug
Details | Diff

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