Making X11DRV_DIB_SetDIBColorTable update DIB visible state
Jukka Heinonen
jhei at iki.fi
Sun Sep 2 04:50:55 CDT 2001
Colonize paints into DIB and after that changes the DIB colormap.
However, Wine failed to notice that updating colormap is an
operation that might alter the visible state of the DIB and
shows the DIB using wrong colors. The following patch fixes this.
Changelog: Changing DIB color table now updates the DIB visible state.
Index: wine/graphics/x11drv/dib.c
===================================================================
RCS file: /home/wine/wine/graphics/x11drv/dib.c,v
retrieving revision 1.78
diff -u -r1.78 dib.c
--- wine/graphics/x11drv/dib.c 2001/07/22 23:13:09 1.78
+++ wine/graphics/x11drv/dib.c 2001/09/02 09:19:52
@@ -4023,8 +4023,16 @@
X11DRV_DIBSECTION *dib = (X11DRV_DIBSECTION *) bmp->dib;
if (dib && dib->colorMap) {
- X11DRV_DIB_GenColorMap( dc, dib->colorMap, DIB_RGB_COLORS, dib->dibSection.
dsBm.bmBitsPixel,
+ /*
+ * Changing color table might change the mapping between
+ * DIB colors and X11 colors and thus alter the visible state
+ * of the bitmap object.
+ */
+ X11DRV_DIB_Lock(bmp, DIB_Status_AppMod, FALSE);
+ X11DRV_DIB_GenColorMap( dc, dib->colorMap, DIB_RGB_COLORS,
+ dib->dibSection.dsBm.bmBitsPixel,
TRUE, colors, start, count + start );
+ X11DRV_DIB_Unlock(bmp, TRUE);
return count;
}
return 0;
--
Jukka Heinonen <http://www.iki.fi/jhei/>
More information about the wine-patches
mailing list