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 4425

Summary: SDL_CreateTextureFromSurface forget to choose an alpha format for palettes with alpha values
Product: SDL Reporter: Sylvain <sylvain.becker>
Component: renderAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: don't know   
Hardware: All   
OS: All   
Attachments: test case

Description Sylvain 2018-12-15 13:41:16 UTC
SDL_CreateTextureFromSurface() forget to choose a texture format with alpha for surfaces that have palette with alpha values.

In the end, it works with opengl renderer because it only has a unique format which has alpha, but it fails with software and opengles2 as it choose a non alpha format.
Comment 1 Sylvain 2018-12-15 13:42:13 UTC
Created attachment 3547 [details]
test case
Comment 2 Sylvain 2018-12-15 13:51:31 UTC
Fixed in https://hg.libsdl.org/SDL/rev/6e387413a916
Comment 3 Sylvain 2020-02-23 09:03:17 UTC
https://hg.libsdl.org/SDL/rev/c66d1c7700bd

Fixed bug 4999 - Palette surface always promoted to alpha (Thanks Cameron Gutman!)
MSVC Static analysis: Incorrect alpha_value check in SDL_render.c
Comment 4 Sylvain 2020-02-23 09:06:15 UTC
re-open because there is another issue with this situation:

- a palette surface without alpha value, but all alpha field with 0.
- using the GLES 1 render, that only has ARGB texture.

=> the texture is always transparent, whereas it should be opaque.
Comment 5 Sylvain 2020-02-23 22:06:43 UTC
Fixed in bug 3827 which has a long history