[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:
Timo Kreuzer
2025-12-13 10:58:21 +02:00
parent ce8329f862
commit 11c276109c

View File

@@ -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);
}