mirror of
https://github.com/reactos/reactos.git
synced 2026-05-31 16:31:07 +08:00
[WIN32K:NTGDI] Mark 2-color indexed palettes as monochrome
This is mostly an optimization, as translation from RGB to mono are much faster than generic indexed palettes. It exposes a broken RGB-to-mono translation though, which previously was hidden for DIB sections, which didn't mark the palette as mono, therefore taking the slow index path, which worked correctly.
This commit is contained in:
@@ -149,6 +149,9 @@ PALETTE_AllocPalette(
|
||||
/* Check color count */
|
||||
if ((cColors == 0) || (cColors > 1024)) return NULL;
|
||||
|
||||
/* Mark 2 color indexed palettes as monochrome */
|
||||
if (cColors == 2) iMode |= PAL_MONOCHROME;
|
||||
|
||||
/* Allocate enough space for the palete entries */
|
||||
cjSize += cColors * sizeof(PALETTEENTRY);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user