mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 08:54:05 +00:00
win32u: Add a debug helper to print color values.
This commit is contained in:
parent
7eb1e94299
commit
3ae7035afd
|
@ -222,7 +222,7 @@ HBRUSH WINAPI NtGdiCreateHatchBrushInternal( INT style, COLORREF color, BOOL pen
|
|||
{
|
||||
LOGBRUSH logbrush;
|
||||
|
||||
TRACE( "%d %06x\n", style, color );
|
||||
TRACE( "%d %s\n", style, debugstr_color(color) );
|
||||
|
||||
logbrush.lbStyle = BS_HATCHED;
|
||||
logbrush.lbColor = color;
|
||||
|
@ -282,7 +282,7 @@ HBRUSH WINAPI NtGdiCreateSolidBrush( COLORREF color, HBRUSH brush )
|
|||
{
|
||||
LOGBRUSH logbrush;
|
||||
|
||||
TRACE("%06x\n", color );
|
||||
TRACE("%s\n", debugstr_color(color) );
|
||||
|
||||
logbrush.lbStyle = BS_SOLID;
|
||||
logbrush.lbColor = color;
|
||||
|
|
|
@ -1056,7 +1056,7 @@ BOOL CDECL dibdrv_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT
|
|||
RECT row;
|
||||
HRGN rgn;
|
||||
|
||||
TRACE( "(%p, %d, %d, %08x, %d)\n", pdev, x, y, color, type );
|
||||
TRACE( "(%p, %d, %d, %s, %d)\n", pdev, x, y, debugstr_color(color), type );
|
||||
|
||||
if (x < 0 || x >= pdev->dib.rect.right - pdev->dib.rect.left ||
|
||||
y < 0 || y >= pdev->dib.rect.bottom - pdev->dib.rect.top) return FALSE;
|
||||
|
@ -1097,7 +1097,7 @@ COLORREF CDECL dibdrv_GetNearestColor( PHYSDEV dev, COLORREF color )
|
|||
DC *dc = get_physdev_dc( dev );
|
||||
DWORD pixel;
|
||||
|
||||
TRACE( "(%p, %08x)\n", dev, color );
|
||||
TRACE( "(%p, %s)\n", dev, debugstr_color(color) );
|
||||
|
||||
pixel = get_pixel_color( dc, &pdev->dib, color, FALSE );
|
||||
return pdev->dib.funcs->pixel_to_colorref( &pdev->dib, pixel );
|
||||
|
@ -1575,7 +1575,7 @@ COLORREF CDECL dibdrv_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color )
|
|||
POINT pt;
|
||||
DWORD pixel;
|
||||
|
||||
TRACE( "(%p, %d, %d, %08x)\n", dev, x, y, color );
|
||||
TRACE( "(%p, %d, %d, %s)\n", dev, x, y, debugstr_color(color) );
|
||||
|
||||
pt.x = x;
|
||||
pt.y = y;
|
||||
|
|
|
@ -384,7 +384,7 @@ UINT WINAPI NtGdiGetNearestPaletteIndex( HPALETTE hpalette, COLORREF color )
|
|||
}
|
||||
GDI_ReleaseObj( hpalette );
|
||||
}
|
||||
TRACE("(%p,%06x): returning %d\n", hpalette, color, index );
|
||||
TRACE("(%p,%s): returning %d\n", hpalette, debugstr_color(color), index );
|
||||
return index;
|
||||
}
|
||||
|
||||
|
@ -413,7 +413,7 @@ COLORREF CDECL nulldrv_GetNearestColor( PHYSDEV dev, COLORREF color )
|
|||
|
||||
if (!get_palette_entries( hpal, index, 1, &entry ))
|
||||
{
|
||||
WARN("RGB(%x) : idx %d is out of bounds, assuming NULL\n", color, index );
|
||||
WARN("%s: idx %d is out of bounds, assuming NULL\n", debugstr_color(color), index );
|
||||
if (!get_palette_entries( hpal, 0, 1, &entry )) return CLR_INVALID;
|
||||
}
|
||||
color = RGB( entry.peRed, entry.peGreen, entry.peBlue );
|
||||
|
|
|
@ -59,7 +59,7 @@ HPEN create_pen( INT style, INT width, COLORREF color )
|
|||
PENOBJ *penPtr;
|
||||
HPEN hpen;
|
||||
|
||||
TRACE( "%d %d %06x\n", style, width, color );
|
||||
TRACE( "%d %d %s\n", style, width, debugstr_color(color) );
|
||||
|
||||
switch (style)
|
||||
{
|
||||
|
|
|
@ -506,4 +506,13 @@ static inline const char *debugstr_us( const UNICODE_STRING *us )
|
|||
return debugstr_wn( us->Buffer, us->Length / sizeof(WCHAR) );
|
||||
}
|
||||
|
||||
static inline const char *debugstr_color( COLORREF color )
|
||||
{
|
||||
if (color & (1 << 24)) /* PALETTEINDEX */
|
||||
return wine_dbg_sprintf( "PALETTEINDEX(%u)", LOWORD(color) );
|
||||
if (color >> 16 == 0x10ff) /* DIBINDEX */
|
||||
return wine_dbg_sprintf( "DIBINDEX(%u)", LOWORD(color) );
|
||||
return wine_dbg_sprintf( "RGB(%02x,%02x,%02x)", GetRValue(color), GetGValue(color), GetBValue(color) );
|
||||
}
|
||||
|
||||
#endif /* __WINE_WIN32U_PRIVATE */
|
||||
|
|
|
@ -2066,7 +2066,7 @@ BOOL WINAPI NtUserSetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alph
|
|||
{
|
||||
BOOL ret;
|
||||
|
||||
TRACE( "(%p,%08x,%d,%x)\n", hwnd, key, alpha, flags );
|
||||
TRACE( "(%p,%s,%d,%x)\n", hwnd, debugstr_color(key), alpha, flags );
|
||||
|
||||
SERVER_START_REQ( set_window_layered_info )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue