diff options
Diffstat (limited to 'xorg-server/hw/xwin/winshadgdi.c')
-rw-r--r-- | xorg-server/hw/xwin/winshadgdi.c | 76 |
1 files changed, 26 insertions, 50 deletions
diff --git a/xorg-server/hw/xwin/winshadgdi.c b/xorg-server/hw/xwin/winshadgdi.c index 912f7e41f..6bfe41179 100644 --- a/xorg-server/hw/xwin/winshadgdi.c +++ b/xorg-server/hw/xwin/winshadgdi.c @@ -92,8 +92,7 @@ winQueryScreenDIBFormat(ScreenPtr pScreen, BITMAPINFOHEADER * pbmih) { winScreenPriv(pScreen); HBITMAP hbmp; - -#if CYGDEBUG +#ifdef WINDBG LPDWORD pdw = NULL; #endif @@ -116,7 +115,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 +168,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; @@ -196,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__, @@ -328,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, @@ -340,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, @@ -373,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 */ @@ -399,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 */ @@ -462,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 */ /* @@ -580,9 +566,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; @@ -622,7 +606,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 */ @@ -649,13 +633,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) { @@ -707,9 +691,7 @@ winInitVisualsShadowGDI(ScreenPtr pScreen) return FALSE; } -#if CYGDEBUG winDebug("winInitVisualsShadowGDI - Returning\n"); -#endif return TRUE; } @@ -868,16 +850,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; } @@ -1082,10 +1060,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 |