forked from Mirrors/wine-wine
winex11: Fix the X image masks according to the pixmap format in Get/SetDIBits.
parent
48e396ea6c
commit
5c5c47269b
|
@ -71,6 +71,7 @@ typedef struct
|
||||||
WORD depth;
|
WORD depth;
|
||||||
WORD infoBpp;
|
WORD infoBpp;
|
||||||
WORD compression;
|
WORD compression;
|
||||||
|
ColorShifts *shifts;
|
||||||
RGBQUAD *colorMap;
|
RGBQUAD *colorMap;
|
||||||
int nColorMap;
|
int nColorMap;
|
||||||
Drawable drawable;
|
Drawable drawable;
|
||||||
|
@ -3541,6 +3542,12 @@ static int X11DRV_DIB_SetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
|
||||||
wine_tsx11_unlock();
|
wine_tsx11_unlock();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if (descr->shifts)
|
||||||
|
{
|
||||||
|
bmpImage->red_mask = descr->shifts->physicalRed.max << descr->shifts->physicalRed.shift;
|
||||||
|
bmpImage->green_mask = descr->shifts->physicalGreen.max << descr->shifts->physicalGreen.shift;
|
||||||
|
bmpImage->blue_mask = descr->shifts->physicalBlue.max << descr->shifts->physicalBlue.shift;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
wine_tsx11_unlock();
|
wine_tsx11_unlock();
|
||||||
|
|
||||||
|
@ -3698,6 +3705,12 @@ static int X11DRV_DIB_GetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
|
||||||
wine_tsx11_unlock();
|
wine_tsx11_unlock();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if (descr->shifts)
|
||||||
|
{
|
||||||
|
bmpImage->red_mask = descr->shifts->physicalRed.max << descr->shifts->physicalRed.shift;
|
||||||
|
bmpImage->green_mask = descr->shifts->physicalGreen.max << descr->shifts->physicalGreen.shift;
|
||||||
|
bmpImage->blue_mask = descr->shifts->physicalBlue.max << descr->shifts->physicalBlue.shift;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBXXSHM
|
#ifdef HAVE_LIBXXSHM
|
||||||
|
@ -3930,6 +3943,7 @@ INT CDECL X11DRV_SetDIBitsToDevice( X11DRV_PDEVICE *physDev, INT xDest, INT yDes
|
||||||
descr.lines = top_down ? -lines : lines;
|
descr.lines = top_down ? -lines : lines;
|
||||||
descr.infoWidth = width;
|
descr.infoWidth = width;
|
||||||
descr.depth = physDev->depth;
|
descr.depth = physDev->depth;
|
||||||
|
descr.shifts = physDev->color_shifts;
|
||||||
descr.drawable = physDev->drawable;
|
descr.drawable = physDev->drawable;
|
||||||
descr.gc = physDev->gc;
|
descr.gc = physDev->gc;
|
||||||
descr.xSrc = xSrc;
|
descr.xSrc = xSrc;
|
||||||
|
@ -4019,6 +4033,7 @@ INT CDECL X11DRV_SetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT start
|
||||||
descr.infoWidth = width;
|
descr.infoWidth = width;
|
||||||
descr.lines = tmpheight >= 0 ? lines : -lines;
|
descr.lines = tmpheight >= 0 ? lines : -lines;
|
||||||
descr.depth = physBitmap->pixmap_depth;
|
descr.depth = physBitmap->pixmap_depth;
|
||||||
|
descr.shifts = physBitmap->trueColor ? &physBitmap->pixmap_color_shifts : NULL;
|
||||||
descr.drawable = physBitmap->pixmap;
|
descr.drawable = physBitmap->pixmap;
|
||||||
descr.gc = get_bitmap_gc(physBitmap->pixmap_depth);
|
descr.gc = get_bitmap_gc(physBitmap->pixmap_depth);
|
||||||
descr.xSrc = 0;
|
descr.xSrc = 0;
|
||||||
|
@ -4175,6 +4190,7 @@ INT CDECL X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT start
|
||||||
descr.infoWidth = width;
|
descr.infoWidth = width;
|
||||||
descr.lines = lines;
|
descr.lines = lines;
|
||||||
descr.depth = physBitmap->pixmap_depth;
|
descr.depth = physBitmap->pixmap_depth;
|
||||||
|
descr.shifts = physBitmap->trueColor ? &physBitmap->pixmap_color_shifts : NULL;
|
||||||
descr.drawable = physBitmap->pixmap;
|
descr.drawable = physBitmap->pixmap;
|
||||||
descr.gc = get_bitmap_gc(physBitmap->pixmap_depth);
|
descr.gc = get_bitmap_gc(physBitmap->pixmap_depth);
|
||||||
descr.width = dib.dsBm.bmWidth;
|
descr.width = dib.dsBm.bmWidth;
|
||||||
|
@ -4250,6 +4266,7 @@ static void X11DRV_DIB_DoCopyDIBSection(X_PHYSBITMAP *physBitmap, BOOL toDIB,
|
||||||
descr.nColorMap = nColorMap;
|
descr.nColorMap = nColorMap;
|
||||||
descr.bits = dibSection.dsBm.bmBits;
|
descr.bits = dibSection.dsBm.bmBits;
|
||||||
descr.depth = physBitmap->pixmap_depth;
|
descr.depth = physBitmap->pixmap_depth;
|
||||||
|
descr.shifts = physBitmap->trueColor ? &physBitmap->pixmap_color_shifts : NULL;
|
||||||
descr.compression = dibSection.dsBmih.biCompression;
|
descr.compression = dibSection.dsBmih.biCompression;
|
||||||
descr.physBitmap = physBitmap;
|
descr.physBitmap = physBitmap;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue