aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winshadgdi.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/winshadgdi.c')
-rwxr-xr-x[-rw-r--r--]xorg-server/hw/xwin/winshadgdi.c79
1 files changed, 28 insertions, 51 deletions
diff --git a/xorg-server/hw/xwin/winshadgdi.c b/xorg-server/hw/xwin/winshadgdi.c
index 3d222ad4b..cda47593b 100644..100755
--- a/xorg-server/hw/xwin/winshadgdi.c
+++ b/xorg-server/hw/xwin/winshadgdi.c
@@ -32,6 +32,7 @@
#include <xwin-config.h>
#endif
#include "win.h"
+#include "winprefs.h"
/*
* Local function prototypes
@@ -92,8 +93,7 @@ winQueryScreenDIBFormat(ScreenPtr pScreen, BITMAPINFOHEADER * pbmih)
{
winScreenPriv(pScreen);
HBITMAP hbmp;
-
-#if CYGDEBUG
+#ifdef WINDBG
LPDWORD pdw = NULL;
#endif
@@ -116,7 +116,7 @@ winQueryScreenDIBFormat(ScreenPtr pScreen, BITMAPINFOHEADER * pbmih)
return FALSE;
}
-#if CYGDEBUG
+#ifdef WINDBG
/* Get a pointer to bitfields */
pdw = (DWORD *) ((CARD8 *) pbmih + sizeof(BITMAPINFOHEADER));
@@ -169,8 +169,8 @@ winQueryRGBBitsAndMasks(ScreenPtr pScreen)
/* Color masks for 24 bpp are standardized */
if (GetDeviceCaps(pScreenPriv->hdcScreen, PLANES)
* GetDeviceCaps(pScreenPriv->hdcScreen, BITSPIXEL) == 24) {
- ErrorF("winQueryRGBBitsAndMasks - GetDeviceCaps (BITSPIXEL) "
- "returned 24 for the screen. Using default 24bpp masks.\n");
+ winDebug ("winQueryRGBBitsAndMasks - GetDeviceCaps (BITSPIXEL) "
+ "returned 24 for the screen. Using default 24bpp masks.\n");
/* 8 bits per primary color */
pScreenPriv->dwBitsPerRGB = 8;
@@ -195,7 +195,7 @@ winQueryRGBBitsAndMasks(ScreenPtr pScreen)
/* Get a pointer to bitfields */
pdw = (DWORD *) ((CARD8 *) pbmih + sizeof(BITMAPINFOHEADER));
-#if CYGDEBUG
+#ifdef WINDBG
winDebug("%s - Masks: %08x %08x %08x\n", __FUNCTION__,
pdw[0], pdw[1], pdw[2]);
winDebug("%s - Bitmap: %dx%d %d bpp %d planes\n", __FUNCTION__,
@@ -327,10 +327,10 @@ winAllocateFBShadowGDI(ScreenPtr pScreen)
pScreenPriv->pbmih->biWidth = pScreenInfo->dwWidth;
pScreenPriv->pbmih->biHeight = -pScreenInfo->dwHeight;
- ErrorF("winAllocateFBShadowGDI - Creating DIB with width: %d height: %d "
- "depth: %d\n",
- (int) pScreenPriv->pbmih->biWidth,
- (int) -pScreenPriv->pbmih->biHeight, pScreenPriv->pbmih->biBitCount);
+ winDebug ("winAllocateFBShadowGDI - Creating DIB with width: %d height: %d "
+ "depth: %d\n",
+ (int) pScreenPriv->pbmih->biWidth,
+ (int) -pScreenPriv->pbmih->biHeight, pScreenPriv->pbmih->biBitCount);
/* Create a DI shadow bitmap with a bit pointer */
pScreenPriv->hbmpShadow = CreateDIBSection(pScreenPriv->hdcScreen,
@@ -339,32 +339,26 @@ winAllocateFBShadowGDI(ScreenPtr pScreen)
(VOID **) &pScreenInfo->pfb,
NULL, 0);
if (pScreenPriv->hbmpShadow == NULL || pScreenInfo->pfb == NULL) {
- winW32Error(2, "winAllocateFBShadowGDI - CreateDIBSection failed:");
+ winW32Error ("winAllocateFBShadowGDI - CreateDIBSection failed:");
return FALSE;
}
else {
-#if CYGDEBUG
winDebug("winAllocateFBShadowGDI - Shadow buffer allocated\n");
-#endif
}
/* Get information about the bitmap that was allocated */
GetObject(pScreenPriv->hbmpShadow, sizeof(dibsection), &dibsection);
-#if CYGDEBUG || YES
/* Print information about bitmap allocated */
winDebug("winAllocateFBShadowGDI - Dibsection width: %d height: %d "
"depth: %d size image: %d\n",
(int) dibsection.dsBmih.biWidth, (int) dibsection.dsBmih.biHeight,
dibsection.dsBmih.biBitCount, (int) dibsection.dsBmih.biSizeImage);
-#endif
/* Select the shadow bitmap into the shadow DC */
SelectObject(pScreenPriv->hdcShadow, pScreenPriv->hbmpShadow);
-#if CYGDEBUG
winDebug("winAllocateFBShadowGDI - Attempting a shadow blit\n");
-#endif
/* Do a test blit from the shadow to the screen, I think */
fReturn = BitBlt(pScreenPriv->hdcScreen,
@@ -372,20 +366,14 @@ winAllocateFBShadowGDI(ScreenPtr pScreen)
pScreenInfo->dwWidth, pScreenInfo->dwHeight,
pScreenPriv->hdcShadow, 0, 0, SRCCOPY);
if (fReturn) {
-#if CYGDEBUG
winDebug("winAllocateFBShadowGDI - Shadow blit success\n");
-#endif
}
else {
- winW32Error(2, "winAllocateFBShadowGDI - Shadow blit failure\n");
-#if 0
- return FALSE;
-#else
+ winW32Error ("winAllocateFBShadowGDI - Shadow blit failure\n");
/* ago: ignore this error. The blit fails with wine, but does not
* cause any problems later. */
fReturn = TRUE;
-#endif
}
/* Look for height weirdness */
@@ -398,10 +386,8 @@ winAllocateFBShadowGDI(ScreenPtr pScreen)
/ dibsection.dsBmih.biHeight)
* 8) / pScreenInfo->dwBPP;
-#if CYGDEBUG || YES
winDebug("winAllocateFBShadowGDI - Created shadow stride: %d\n",
(int) pScreenInfo->dwStride);
-#endif
#ifdef XWIN_MULTIWINDOW
/* Redraw all windows */
@@ -461,15 +447,16 @@ winShadowUpdateGDI(ScreenPtr pScreen, shadowBufPtr pBuf)
if (dwBox != 1) {
++s_dwNonUnitRegions;
- ErrorF("winShadowUpdatGDI - dwBox: %d\n", dwBox);
+ winDebug ("winShadowUpdatGDI - dwBox: %d\n", dwBox);
}
if ((s_dwTotalUpdates % 100) == 0)
- ErrorF("winShadowUpdateGDI - %d%% non-unity regions, avg boxes: %d "
- "nu: %d tu: %d\n",
- (s_dwNonUnitRegions * 100) / s_dwTotalUpdates,
- s_dwTotalBoxes / s_dwTotalUpdates,
- s_dwNonUnitRegions, s_dwTotalUpdates);
+ winDebug ("winShadowUpdateGDI - %d%% non-unity regions, avg boxes: %d "
+ "nu: %d tu: %d\n",
+ (s_dwNonUnitRegions * 100) / s_dwTotalUpdates,
+ s_dwTotalBoxes / s_dwTotalUpdates,
+ s_dwNonUnitRegions, s_dwTotalUpdates);
+ }
#endif /* XWIN_UPDATESTATS */
/*
@@ -578,9 +565,7 @@ winCloseScreenShadowGDI(ScreenPtr pScreen)
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
Bool fReturn;
-#if CYGDEBUG
winDebug("winCloseScreenShadowGDI - Freeing screen resources\n");
-#endif
/* Flag that the screen is closed */
pScreenPriv->fClosed = TRUE;
@@ -603,7 +588,7 @@ winCloseScreenShadowGDI(ScreenPtr pScreen)
ReleaseDC(pScreenPriv->hwndScreen, pScreenPriv->hdcScreen);
/* Delete tray icon, if we have one */
- if (!pScreenInfo->fNoTrayIcon)
+ if (!pScreenInfo->fNoTrayIcon && !pref.fNoTrayIcon)
winDeleteNotifyIcon(pScreenPriv);
/* Free the exit confirmation dialog box, if it exists */
@@ -620,7 +605,7 @@ winCloseScreenShadowGDI(ScreenPtr pScreen)
#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
/* Destroy the thread startup mutex */
- pthread_mutex_destroy(&pScreenPriv->pmServerStarted);
+ if (pScreenPriv->pmServerStarted) pthread_mutex_destroy (&pScreenPriv->pmServerStarted);
#endif
/* Invalidate our screeninfo's pointer to the screen */
@@ -647,13 +632,13 @@ winInitVisualsShadowGDI(ScreenPtr pScreen)
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
/* Display debugging information */
- ErrorF("winInitVisualsShadowGDI - Masks %08x %08x %08x BPRGB %d d %d "
- "bpp %d\n",
- (unsigned int) pScreenPriv->dwRedMask,
- (unsigned int) pScreenPriv->dwGreenMask,
- (unsigned int) pScreenPriv->dwBlueMask,
- (int) pScreenPriv->dwBitsPerRGB,
- (int) pScreenInfo->dwDepth, (int) pScreenInfo->dwBPP);
+ winDebug ("winInitVisualsShadowGDI - Masks %08x %08x %08x BPRGB %d d %d "
+ "bpp %d\n",
+ (unsigned int) pScreenPriv->dwRedMask,
+ (unsigned int) pScreenPriv->dwGreenMask,
+ (unsigned int) pScreenPriv->dwBlueMask,
+ (int) pScreenPriv->dwBitsPerRGB,
+ (int) pScreenInfo->dwDepth, (int) pScreenInfo->dwBPP);
/* Create a single visual according to the Windows screen depth */
switch (pScreenInfo->dwDepth) {
@@ -705,9 +690,7 @@ winInitVisualsShadowGDI(ScreenPtr pScreen)
return FALSE;
}
-#if CYGDEBUG
winDebug("winInitVisualsShadowGDI - Returning\n");
-#endif
return TRUE;
}
@@ -866,16 +849,12 @@ winRealizeInstalledPaletteShadowGDI(ScreenPtr pScreen)
winScreenPriv(pScreen);
winPrivCmapPtr pCmapPriv = NULL;
-#if CYGDEBUG
winDebug("winRealizeInstalledPaletteShadowGDI\n");
-#endif
/* Don't do anything if there is not a colormap */
if (pScreenPriv->pcmapInstalled == NULL) {
-#if CYGDEBUG
winDebug("winRealizeInstalledPaletteShadowGDI - No colormap "
"installed\n");
-#endif
return TRUE;
}
@@ -1080,10 +1059,8 @@ winDestroyColormapShadowGDI(ColormapPtr pColormap)
* we need to handle the default colormap in a special way.
*/
if (pColormap->flags & IsDefault) {
-#if CYGDEBUG
winDebug("winDestroyColormapShadowGDI - Destroying default "
"colormap\n");
-#endif
/*
* FIXME: Walk the list of all screens, popping the default