winex11: Don't use ColorShifts for non-TrueColor bitmaps.
This commit is contained in:
parent
6bd43fbb49
commit
9465700083
|
@ -102,6 +102,7 @@ HBITMAP CDECL X11DRV_SelectBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
|
||||||
|
|
||||||
physDev->bitmap = physBitmap;
|
physDev->bitmap = physBitmap;
|
||||||
physDev->drawable = physBitmap->pixmap;
|
physDev->drawable = physBitmap->pixmap;
|
||||||
|
physDev->color_shifts = physBitmap->trueColor ? &physBitmap->pixmap_color_shifts : NULL;
|
||||||
SetRect( &physDev->drawable_rect, 0, 0, bitmap.bmWidth, bitmap.bmHeight );
|
SetRect( &physDev->drawable_rect, 0, 0, bitmap.bmWidth, bitmap.bmHeight );
|
||||||
physDev->dc_rect = physDev->drawable_rect;
|
physDev->dc_rect = physDev->drawable_rect;
|
||||||
|
|
||||||
|
@ -119,11 +120,6 @@ HBITMAP CDECL X11DRV_SelectBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
|
||||||
wine_tsx11_unlock();
|
wine_tsx11_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(physDev->depth == 1)
|
|
||||||
physDev->color_shifts = NULL;
|
|
||||||
else
|
|
||||||
physDev->color_shifts = &physBitmap->pixmap_color_shifts;
|
|
||||||
|
|
||||||
return hbitmap;
|
return hbitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,11 +163,13 @@ BOOL CDECL X11DRV_CreateBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, LPVOID
|
||||||
if(bitmap.bmBitsPixel == 1)
|
if(bitmap.bmBitsPixel == 1)
|
||||||
{
|
{
|
||||||
physBitmap->pixmap_depth = 1;
|
physBitmap->pixmap_depth = 1;
|
||||||
|
physBitmap->trueColor = FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
physBitmap->pixmap_depth = screen_depth;
|
physBitmap->pixmap_depth = screen_depth;
|
||||||
physBitmap->pixmap_color_shifts = X11DRV_PALETTE_default_shifts;
|
physBitmap->pixmap_color_shifts = X11DRV_PALETTE_default_shifts;
|
||||||
|
physBitmap->trueColor = (visual->class == TrueColor || visual->class == DirectColor);
|
||||||
}
|
}
|
||||||
physBitmap->pixmap = XCreatePixmap(gdi_display, root_window,
|
physBitmap->pixmap = XCreatePixmap(gdi_display, root_window,
|
||||||
bitmap.bmWidth, bitmap.bmHeight, physBitmap->pixmap_depth);
|
bitmap.bmWidth, bitmap.bmHeight, physBitmap->pixmap_depth);
|
||||||
|
|
|
@ -4749,11 +4749,13 @@ HBITMAP CDECL X11DRV_CreateDIBSection( X11DRV_PDEVICE *physDev, HBITMAP hbitmap,
|
||||||
if(dib.dsBm.bmBitsPixel == 1)
|
if(dib.dsBm.bmBitsPixel == 1)
|
||||||
{
|
{
|
||||||
physBitmap->pixmap_depth = 1;
|
physBitmap->pixmap_depth = 1;
|
||||||
|
physBitmap->trueColor = FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
physBitmap->pixmap_depth = screen_depth;
|
physBitmap->pixmap_depth = screen_depth;
|
||||||
physBitmap->pixmap_color_shifts = X11DRV_PALETTE_default_shifts;
|
physBitmap->pixmap_color_shifts = X11DRV_PALETTE_default_shifts;
|
||||||
|
physBitmap->trueColor = (visual->class == TrueColor || visual->class == DirectColor);
|
||||||
}
|
}
|
||||||
#ifdef HAVE_LIBXXSHM
|
#ifdef HAVE_LIBXXSHM
|
||||||
physBitmap->shminfo.shmid = -1;
|
physBitmap->shminfo.shmid = -1;
|
||||||
|
|
|
@ -124,6 +124,7 @@ typedef struct
|
||||||
XImage *image; /* cached XImage */
|
XImage *image; /* cached XImage */
|
||||||
int *colorMap; /* color map info */
|
int *colorMap; /* color map info */
|
||||||
int nColorMap;
|
int nColorMap;
|
||||||
|
BOOL trueColor;
|
||||||
CRITICAL_SECTION lock; /* GDI access lock */
|
CRITICAL_SECTION lock; /* GDI access lock */
|
||||||
enum x11drv_shm_mode shm_mode;
|
enum x11drv_shm_mode shm_mode;
|
||||||
#ifdef HAVE_LIBXXSHM
|
#ifdef HAVE_LIBXXSHM
|
||||||
|
|
Loading…
Reference in New Issue