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 5095

Summary: macOS has over-saturated colors when system colorspace isn't sRGB
Product: SDL Reporter: michaeljosephmaltese
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: ASSIGNED --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.1   
Hardware: All   
OS: Mac OS X (All)   

Description michaeljosephmaltese 2020-04-15 20:35:04 UTC
On macOS, the display rendered is over-saturated.

You can see this by e.g. opening a PNG in Preview.app, and then displaying the same image in SDL (using a loader like libpng, libspng, lodepng, stb_image, etc that bypasses the system color management).

There was a previous commit to fix this https://hg.libsdl.org/SDL/rev/e5b39f4935c8 that set the window colorspace to sRGB, but apparently caused performance issues https://hg.libsdl.org/SDL/rev/3a847ed9f8b1https://hg.libsdl.org/SDL/rev/3a847ed9f8b1 .  I couldn't find any other references to this issue, though note that OpenTTD was able to _improve_ performance by setting the colorspace https://github.com/OpenTTD/OpenTTD/issues/7644

If setting the colorspace causes performance issues, then we should figure out another way to do it such that colors are rendered correctly.