winex11: Use ColorShifts from physDev in X11DRV_PALETTE_ToPhysical.
This commit is contained in:
parent
3ad349f316
commit
5fc017c497
@ -110,6 +110,10 @@ HBITMAP CDECL X11DRV_SelectBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
|
|||||||
if (physDev->depth != physBitmap->pixmap_depth)
|
if (physDev->depth != physBitmap->pixmap_depth)
|
||||||
{
|
{
|
||||||
physDev->depth = physBitmap->pixmap_depth;
|
physDev->depth = physBitmap->pixmap_depth;
|
||||||
|
if(physDev->depth == 1)
|
||||||
|
physDev->color_shifts = NULL;
|
||||||
|
else
|
||||||
|
physDev->color_shifts = &physBitmap->pixmap_color_shifts;
|
||||||
wine_tsx11_lock();
|
wine_tsx11_lock();
|
||||||
XFreeGC( gdi_display, physDev->gc );
|
XFreeGC( gdi_display, physDev->gc );
|
||||||
physDev->gc = XCreateGC( gdi_display, physDev->drawable, 0, NULL );
|
physDev->gc = XCreateGC( gdi_display, physDev->drawable, 0, NULL );
|
||||||
@ -158,7 +162,15 @@ BOOL CDECL X11DRV_CreateBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, LPVOID
|
|||||||
|
|
||||||
/* Create the pixmap */
|
/* Create the pixmap */
|
||||||
wine_tsx11_lock();
|
wine_tsx11_lock();
|
||||||
physBitmap->pixmap_depth = (bitmap.bmBitsPixel == 1) ? 1 : screen_depth;
|
if(bitmap.bmBitsPixel == 1)
|
||||||
|
{
|
||||||
|
physBitmap->pixmap_depth = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
physBitmap->pixmap_depth = screen_depth;
|
||||||
|
physBitmap->pixmap_color_shifts = X11DRV_PALETTE_default_shifts;
|
||||||
|
}
|
||||||
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);
|
||||||
wine_tsx11_unlock();
|
wine_tsx11_unlock();
|
||||||
|
@ -4746,7 +4746,15 @@ HBITMAP CDECL X11DRV_CreateDIBSection( X11DRV_PDEVICE *physDev, HBITMAP hbitmap,
|
|||||||
|
|
||||||
/* create pixmap and X image */
|
/* create pixmap and X image */
|
||||||
wine_tsx11_lock();
|
wine_tsx11_lock();
|
||||||
physBitmap->pixmap_depth = (dib.dsBm.bmBitsPixel == 1) ? 1 : screen_depth;
|
if(dib.dsBm.bmBitsPixel == 1)
|
||||||
|
{
|
||||||
|
physBitmap->pixmap_depth = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
physBitmap->pixmap_depth = screen_depth;
|
||||||
|
physBitmap->pixmap_color_shifts = X11DRV_PALETTE_default_shifts;
|
||||||
|
}
|
||||||
#ifdef HAVE_LIBXXSHM
|
#ifdef HAVE_LIBXXSHM
|
||||||
physBitmap->shminfo.shmid = -1;
|
physBitmap->shminfo.shmid = -1;
|
||||||
|
|
||||||
|
@ -138,6 +138,7 @@ BOOL CDECL X11DRV_CreateDC( HDC hdc, X11DRV_PDEVICE **pdev, LPCWSTR driver, LPCW
|
|||||||
physDev->bitmap = &BITMAP_stock_phys_bitmap;
|
physDev->bitmap = &BITMAP_stock_phys_bitmap;
|
||||||
physDev->drawable = BITMAP_stock_phys_bitmap.pixmap;
|
physDev->drawable = BITMAP_stock_phys_bitmap.pixmap;
|
||||||
physDev->depth = 1;
|
physDev->depth = 1;
|
||||||
|
physDev->color_shifts = NULL;
|
||||||
SetRect( &physDev->drawable_rect, 0, 0, 1, 1 );
|
SetRect( &physDev->drawable_rect, 0, 0, 1, 1 );
|
||||||
physDev->dc_rect = physDev->drawable_rect;
|
physDev->dc_rect = physDev->drawable_rect;
|
||||||
}
|
}
|
||||||
@ -146,6 +147,7 @@ BOOL CDECL X11DRV_CreateDC( HDC hdc, X11DRV_PDEVICE **pdev, LPCWSTR driver, LPCW
|
|||||||
physDev->bitmap = NULL;
|
physDev->bitmap = NULL;
|
||||||
physDev->drawable = root_window;
|
physDev->drawable = root_window;
|
||||||
physDev->depth = screen_depth;
|
physDev->depth = screen_depth;
|
||||||
|
physDev->color_shifts = &X11DRV_PALETTE_default_shifts;
|
||||||
physDev->drawable_rect = virtual_screen_rect;
|
physDev->drawable_rect = virtual_screen_rect;
|
||||||
SetRect( &physDev->dc_rect, 0, 0, virtual_screen_rect.right - virtual_screen_rect.left,
|
SetRect( &physDev->dc_rect, 0, 0, virtual_screen_rect.right - virtual_screen_rect.left,
|
||||||
virtual_screen_rect.bottom - virtual_screen_rect.top );
|
virtual_screen_rect.bottom - virtual_screen_rect.top );
|
||||||
|
@ -60,7 +60,7 @@ Colormap X11DRV_PALETTE_PaletteXColormap = 0;
|
|||||||
UINT16 X11DRV_PALETTE_PaletteFlags = 0;
|
UINT16 X11DRV_PALETTE_PaletteFlags = 0;
|
||||||
|
|
||||||
/* initialize to zero to handle abortive X11DRV_PALETTE_VIRTUAL visuals */
|
/* initialize to zero to handle abortive X11DRV_PALETTE_VIRTUAL visuals */
|
||||||
static ColorShifts X11DRV_PALETTE_default_shifts = { {0,0,0,}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} };
|
ColorShifts X11DRV_PALETTE_default_shifts = { {0,0,0,}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} };
|
||||||
static int X11DRV_PALETTE_Graymax = 0;
|
static int X11DRV_PALETTE_Graymax = 0;
|
||||||
|
|
||||||
static int palette_size;
|
static int palette_size;
|
||||||
@ -874,6 +874,9 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color )
|
|||||||
PALETTEENTRY entry;
|
PALETTEENTRY entry;
|
||||||
ColorShifts *shifts = &X11DRV_PALETTE_default_shifts;
|
ColorShifts *shifts = &X11DRV_PALETTE_default_shifts;
|
||||||
|
|
||||||
|
if(physDev->color_shifts)
|
||||||
|
shifts = physDev->color_shifts;
|
||||||
|
|
||||||
if ( X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_FIXED )
|
if ( X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_FIXED )
|
||||||
{
|
{
|
||||||
/* there is no colormap limitation; we are going to have to compute
|
/* there is no colormap limitation; we are going to have to compute
|
||||||
|
@ -118,6 +118,7 @@ typedef struct
|
|||||||
Pixmap pixmap;
|
Pixmap pixmap;
|
||||||
XID glxpixmap;
|
XID glxpixmap;
|
||||||
int pixmap_depth;
|
int pixmap_depth;
|
||||||
|
ColorShifts pixmap_color_shifts;
|
||||||
/* the following fields are only used for DIB section bitmaps */
|
/* the following fields are only used for DIB section bitmaps */
|
||||||
int status, p_status; /* mapping status */
|
int status, p_status; /* mapping status */
|
||||||
XImage *image; /* cached XImage */
|
XImage *image; /* cached XImage */
|
||||||
@ -155,6 +156,7 @@ typedef struct
|
|||||||
int backgroundPixel;
|
int backgroundPixel;
|
||||||
int textPixel;
|
int textPixel;
|
||||||
int depth; /* bit depth of the DC */
|
int depth; /* bit depth of the DC */
|
||||||
|
ColorShifts *color_shifts; /* color shifts of the DC */
|
||||||
int exposures; /* count of graphics exposures operations */
|
int exposures; /* count of graphics exposures operations */
|
||||||
int current_pf;
|
int current_pf;
|
||||||
Drawable gl_drawable;
|
Drawable gl_drawable;
|
||||||
@ -480,6 +482,7 @@ extern UINT16 X11DRV_PALETTE_PaletteFlags;
|
|||||||
|
|
||||||
extern int *X11DRV_PALETTE_PaletteToXPixel;
|
extern int *X11DRV_PALETTE_PaletteToXPixel;
|
||||||
extern int *X11DRV_PALETTE_XPixelToPalette;
|
extern int *X11DRV_PALETTE_XPixelToPalette;
|
||||||
|
extern ColorShifts X11DRV_PALETTE_default_shifts;
|
||||||
|
|
||||||
extern int X11DRV_PALETTE_mapEGAPixel[16];
|
extern int X11DRV_PALETTE_mapEGAPixel[16];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user