SDL icon indicating copy to clipboard operation
SDL copied to clipboard

Bit order not specified in <8bpp blitters

Open ccawley2011 opened this issue 3 years ago • 2 comments

The blitters in src/video/SDL_blit_0.c don't seem to attempt to distinguish between SDL_PIXELFORMAT_INDEX1LSB and SDL_PIXELFORMAT_INDEX1MSB, or SDL_PIXELFORMAT_INDEX4LSB and SDL_PIXELFORMAT_INDEX4MSB, which potentially results in incorrect conversion to higher bit depths.

ccawley2011 avatar Sep 16 '22 18:09 ccawley2011

Yup, good point. Feel free to submit a tested PR to fix this. Ideally you'd update the automated tests to cover this case.

slouken avatar Sep 16 '22 18:09 slouken

Am I correct in thinking that the current blitters are correct for MSB formats?

ccawley2011 avatar Sep 16 '22 20:09 ccawley2011

I don't know, can you write a quick test case to find out?

slouken avatar Nov 11 '22 16:11 slouken

Yes, I confirmed the current blitters assume MSB format.

slouken avatar Nov 17 '22 09:11 slouken