From d1bb7f714583ff3d220fd2a95a9a9627db8122f9 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Sat, 22 May 1999 19:19:19 +0000 Subject: [PATCH] Disable passing device context to X11DRV_DIB_BuildColorMap when RGB colormap is used. --- graphics/x11drv/dib.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/graphics/x11drv/dib.c b/graphics/x11drv/dib.c index 4ae41cc6661..c6060b62686 100644 --- a/graphics/x11drv/dib.c +++ b/graphics/x11drv/dib.c @@ -1442,9 +1442,9 @@ INT X11DRV_DIB_SetDIBits( if (descr.infoBpp <= 8) { - descr.colorMap = X11DRV_DIB_BuildColorMap( descr.dc, coloruse, - bmp->bitmap.bmBitsPixel, - info, &descr.nColorMap ); + descr.colorMap = X11DRV_DIB_BuildColorMap( + coloruse == DIB_PAL_COLORS? descr.dc : NULL, + coloruse, bmp->bitmap.bmBitsPixel, info, &descr.nColorMap ); if (!descr.colorMap) { return 0; @@ -2172,11 +2172,8 @@ HBITMAP X11DRV_DIB_CreateDIBSection( /* Create Color Map */ if (bm.bmBits && bm.bmBitsPixel <= 8) - { - if(dc) - colorMap = X11DRV_DIB_BuildColorMap( dc, usage, bm.bmBitsPixel, - bmi, &nColorMap ); - } + colorMap = X11DRV_DIB_BuildColorMap( usage == DIB_PAL_COLORS? dc : NULL, + usage, bm.bmBitsPixel, bmi, &nColorMap ); /* Allocate Memory for DIB and fill structure */ if (bm.bmBits) -- 2.11.4.GIT