From: Gregor Schneider Date: Wed, 23 Dec 2009 17:41:20 +0000 (+0000) Subject: [win32k] NtGdiSetDIBitsToDeviceInternal: X-Git-Tag: backups/aicom-network-stable@46924~175 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=1cb212272070d3039f82de4bc8e57a38b6522e8b [win32k] NtGdiSetDIBitsToDeviceInternal: - Choose the number of scan lines from the parameter and the bitmap size - Add scan line offset to the destination rectangle top left corner (fixes drawing images line by line) - Add debug print for further problem solving (deactivated) svn path=/trunk/; revision=44741 --- diff --git a/reactos/subsystems/win32/win32k/objects/dibobj.c b/reactos/subsystems/win32/win32k/objects/dibobj.c index 6b34a31d22c..6a5d4044527 100644 --- a/reactos/subsystems/win32/win32k/objects/dibobj.c +++ b/reactos/subsystems/win32/win32k/objects/dibobj.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ReactOS W32 Subsystem * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team * @@ -489,6 +487,8 @@ NtGdiSetDIBitsToDeviceInternal( pDestSurf = pSurf ? &pSurf->SurfObj : NULL; + ScanLines = min(ScanLines, abs(bmi->bmiHeader.biHeight) - StartScan); + rcDest.left = XDest; rcDest.top = YDest; if (bTransformCoordinates) @@ -499,11 +499,14 @@ NtGdiSetDIBitsToDeviceInternal( rcDest.top += pDC->ptlDCOrig.y; rcDest.right = rcDest.left + Width; rcDest.bottom = rcDest.top + Height; + rcDest.top += StartScan; + ptSource.x = XSrc; ptSource.y = YSrc; SourceSize.cx = bmi->bmiHeader.biWidth; - SourceSize.cy = ScanLines; // this one --> abs(bmi->bmiHeader.biHeight) - StartScan + SourceSize.cy = ScanLines; + DIBWidth = DIB_GetDIBWidthBytes(SourceSize.cx, bmi->bmiHeader.biBitCount); hSourceBitmap = EngCreateBitmap(SourceSize, @@ -556,6 +559,9 @@ NtGdiSetDIBitsToDeviceInternal( EXLATEOBJ_vInitialize(&exlo, ppalDIB, ppalDDB, 0, 0, 0); /* Copy the bits */ + DPRINT("BitsToDev with dstsurf=(%d|%d) (%d|%d), src=(%d|%d) w=%d h=%d\n", + rcDest.left, rcDest.top, rcDest.right, rcDest.bottom, + ptSource.x, ptSource.y, SourceSize.cx, SourceSize.cy); Status = IntEngBitBlt(pDestSurf, pSourceSurf, NULL, @@ -574,8 +580,7 @@ NtGdiSetDIBitsToDeviceInternal( Exit: if (NT_SUCCESS(Status)) { - /* FIXME: Should probably be only the number of lines actually copied */ - ret = ScanLines; // this one --> abs(Info->bmiHeader.biHeight) - StartScan; + ret = ScanLines; } if (ppalDIB) PALETTE_UnlockPalette(ppalDIB);