Cause of depth 16 color problem found
Hans-Martin Mosner <[email protected]>
| Newsgroups | gmane.linux.ports.ppc.mol.general |
|---|---|
| Message-ID | <[email protected]> |
Hi folks, I've always wondered why MOL did not work correctly on my 16-bit X display when I use 16-bit Macintosh screen depth. Today I debugged a little and found the cause of the problem (and a solution): When using 16 bit depth, MOL needs to convert from 555 format as used by the Mac to 565 format as used by X. It does this in the vs.blit_hook_pre function. After sending the converted bits to the X server, they are converted back to 555 format. However, when we use the shm extension, the bits in the buffer are converted back before the X server has processed them. I've added an XSync call in blit_rect() just before the vs.blit_hook_post() call, and that did the job. I have not done any performance comparisons yet (when I want MOL to be reasonably fast on this old 233 MHz machine, I use fb video anyway). Of course, the problem can be avoided by not using shm when pre/postprocessing of pixels is needed. I have no idea whether that would be faster than the XSync solution, though. What would be the best way to get this fix into the MOL source tree? Cheers, Hans-Martin