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 3000 - [OS X 10.6] change 9622 causes 8-bit color modes to be used for fullscreen
Summary: [OS X 10.6] change 9622 causes 8-bit color modes to be used for fullscreen
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86 Other
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.4
Depends on:
Blocks:
 
Reported: 2015-06-03 22:52 UTC by Eric Wasylishen
Modified: 2015-06-04 06:13 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Wasylishen 2015-06-03 22:52:31 UTC
Hi,
With this change, I'm getting 8-bit color in fullscreen mode on OS X 10.6:
https://hg.libsdl.org/SDL/rev/fb91c22f656b

Can be reproduced with the 'testgl2' sample. When you enter fullscreen with Ctrl+Enter, there are strong dithering artifacts that look like 8-bit.

It doesn't happen on 10.7 or newer.



What appears to be happening is, in GetDisplayMode:
- 'fmt' is IO8BitIndexedPixels
- bpp is set to 0 on line 155: "bpp = 0;  /* ignore 8-bit and such for now. */"
- Then in the switch below, bpp 0 hits the /* Totally unrecognizable format */ case, and is reported falsely as SDL_PIXELFORMAT_ARGB8888.


I haven't debugged outside of this function, but presumably SDL is deciding to use this fake SDL_PIXELFORMAT_ARGB8888 mode that is actually 8-bit paletted.


I would either revert change 9622, or add the following on line 151:

else if (CFStringCompare(fmt, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
   bpp = 8;
}

However, with that fix, I worry that another unusual format listed in IOGraphicsTypes.h might come up and trigger the same kind of bug.
Comment 1 Ryan C. Gordon 2015-06-04 00:38:58 UTC
Crap.

--ryan.
Comment 2 Ryan C. Gordon 2015-06-04 06:13:26 UTC
Backed out the problem changes in https://hg.libsdl.org/SDL/rev/1c0e96906974

--ryan.