winex11: Distinguish between bpp and depth.

This commit is contained in:
Stefan Dösinger 2007-12-16 14:00:45 +01:00 committed by Alexandre Julliard
parent 126e5d2cb1
commit ccab10bd46
9 changed files with 19 additions and 14 deletions

View File

@ -123,10 +123,10 @@ BOOL X11DRV_CreateBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, LPVOID bmBit
/* check if bpp is compatible with screen depth */
if (!((bitmap.bmBitsPixel == 1) ||
(bitmap.bmBitsPixel == screen_depth) ||
(bitmap.bmBitsPixel == 24 && screen_depth == 32) || /* FIXME: Not compatible */
(bitmap.bmBitsPixel == 32 && screen_depth == 24) || /* FIXME: Not compatible */
(bitmap.bmBitsPixel == 16 && screen_depth == 15))) /* TODO: Confirm this */
(bitmap.bmBitsPixel == screen_bpp) ||
(bitmap.bmBitsPixel == 24 && screen_bpp == 32) || /* FIXME: Not compatible */
(bitmap.bmBitsPixel == 32 && screen_bpp == 24) || /* FIXME: Not compatible */
(bitmap.bmBitsPixel == 16 && screen_bpp == 15))) /* TODO: Confirm this */
{
ERR("Trying to make bitmap with planes=%d, bpp=%d\n",
bitmap.bmPlanes, bitmap.bmBitsPixel);

View File

@ -103,7 +103,7 @@ static int X11DRV_resize_desktop( unsigned int width, unsigned int height )
static int X11DRV_desktop_GetCurrentMode(void)
{
unsigned int i;
DWORD dwBpp = screen_depth;
DWORD dwBpp = screen_bpp;
if (dwBpp == 24) dwBpp = 32;
for (i=0; i<dd_mode_count; i++)
{
@ -118,7 +118,7 @@ static int X11DRV_desktop_GetCurrentMode(void)
static LONG X11DRV_desktop_SetCurrentMode(int mode)
{
DWORD dwBpp = screen_depth;
DWORD dwBpp = screen_bpp;
if (dwBpp == 24) dwBpp = 32;
if (dwBpp != dd_modes[mode].dwBPP)
{

View File

@ -202,7 +202,7 @@ INT X11DRV_GetDeviceCaps( X11DRV_PDEVICE *physDev, INT cap )
case DESKTOPVERTRES:
return virtual_screen_rect.bottom - virtual_screen_rect.top;
case BITSPIXEL:
return screen_depth;
return screen_bpp;
case PLANES:
return 1;
case NUMBRUSHES:

View File

@ -86,7 +86,7 @@ LPDDHALMODEINFO X11DRV_Settings_SetHandlers(const char *name,
void X11DRV_Settings_AddOneMode(unsigned int width, unsigned int height, unsigned int bpp, unsigned int freq)
{
LPDDHALMODEINFO info = &(dd_modes[dd_mode_count]);
DWORD dwBpp = screen_depth;
DWORD dwBpp = screen_bpp;
if (dd_mode_count >= dd_max_modes)
{
ERR("Maximum modes (%d) exceeded\n", dd_max_modes);
@ -114,8 +114,9 @@ void X11DRV_Settings_AddDepthModes(void)
{
int i, j;
int existing_modes = dd_mode_count;
DWORD dwBpp = screen_depth;
DWORD dwBpp = screen_bpp;
if (dwBpp == 24) dwBpp = 32;
for (j=0; j<3; j++)
{
if (depths[j] != dwBpp)

View File

@ -895,7 +895,7 @@ void X11DRV_handle_desktop_resize( unsigned int width, unsigned int height )
SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE, NULL );
data->lock_changes--;
ClipCursor(NULL);
SendMessageTimeoutW( HWND_BROADCAST, WM_DISPLAYCHANGE, screen_depth,
SendMessageTimeoutW( HWND_BROADCAST, WM_DISPLAYCHANGE, screen_bpp,
MAKELPARAM( width, height ), SMTO_ABORTIFHUNG, 2000, NULL );
EnumWindows( update_windows_on_desktop_resize, (LPARAM)&resize_data );

View File

@ -531,6 +531,7 @@ extern Visual *visual;
extern Window root_window;
extern unsigned int screen_width;
extern unsigned int screen_height;
extern unsigned int screen_bpp;
extern unsigned int screen_depth;
extern RECT virtual_screen_rect;
extern unsigned int text_caps;

View File

@ -70,6 +70,7 @@ Screen *screen;
Visual *visual;
unsigned int screen_width;
unsigned int screen_height;
unsigned int screen_bpp;
unsigned int screen_depth;
RECT virtual_screen_rect;
Window root_window;
@ -491,6 +492,8 @@ static BOOL process_attach(void)
XFree(desktop_vi);
}
screen_bpp = screen_depth; /* TODO */
XInternAtoms( display, (char **)atom_names, NB_XATOMS - FIRST_XATOM, False, X11DRV_Atoms );
if (TRACE_ON(synchronous)) XSynchronize( display, True );

View File

@ -178,7 +178,7 @@ static LONG X11DRV_XRandR_SetCurrentMode(int mode)
short rate;
unsigned int i;
int j;
DWORD dwBpp = screen_depth;
DWORD dwBpp = screen_bpp;
if (dwBpp == 24) dwBpp = 32;
wine_tsx11_lock();

View File

@ -94,7 +94,7 @@ static int X11DRV_XF86VM_GetCurrentMode(void)
int dotclock;
unsigned int i;
DDHALMODEINFO cmode;
DWORD dwBpp = screen_depth;
DWORD dwBpp = screen_bpp;
if (dwBpp == 24) dwBpp = 32;
TRACE("Querying XVidMode current mode\n");
@ -113,7 +113,7 @@ static int X11DRV_XF86VM_GetCurrentMode(void)
static LONG X11DRV_XF86VM_SetCurrentMode(int mode)
{
DWORD dwBpp = screen_depth;
DWORD dwBpp = screen_bpp;
if (dwBpp == 24) dwBpp = 32;
/* only set modes from the original color depth */
if (dwBpp != dd_modes[mode].dwBPP)