mirror of
https://github.com/reactos/reactos.git
synced 2024-08-21 19:03:01 +00:00
[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
This commit is contained in:
parent
900787a278
commit
1cb2122720
|
@ -1,6 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
* ReactOS W32 Subsystem
|
* ReactOS W32 Subsystem
|
||||||
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
|
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
|
||||||
*
|
*
|
||||||
|
@ -489,6 +487,8 @@ NtGdiSetDIBitsToDeviceInternal(
|
||||||
|
|
||||||
pDestSurf = pSurf ? &pSurf->SurfObj : NULL;
|
pDestSurf = pSurf ? &pSurf->SurfObj : NULL;
|
||||||
|
|
||||||
|
ScanLines = min(ScanLines, abs(bmi->bmiHeader.biHeight) - StartScan);
|
||||||
|
|
||||||
rcDest.left = XDest;
|
rcDest.left = XDest;
|
||||||
rcDest.top = YDest;
|
rcDest.top = YDest;
|
||||||
if (bTransformCoordinates)
|
if (bTransformCoordinates)
|
||||||
|
@ -499,11 +499,14 @@ NtGdiSetDIBitsToDeviceInternal(
|
||||||
rcDest.top += pDC->ptlDCOrig.y;
|
rcDest.top += pDC->ptlDCOrig.y;
|
||||||
rcDest.right = rcDest.left + Width;
|
rcDest.right = rcDest.left + Width;
|
||||||
rcDest.bottom = rcDest.top + Height;
|
rcDest.bottom = rcDest.top + Height;
|
||||||
|
rcDest.top += StartScan;
|
||||||
|
|
||||||
ptSource.x = XSrc;
|
ptSource.x = XSrc;
|
||||||
ptSource.y = YSrc;
|
ptSource.y = YSrc;
|
||||||
|
|
||||||
SourceSize.cx = bmi->bmiHeader.biWidth;
|
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);
|
DIBWidth = DIB_GetDIBWidthBytes(SourceSize.cx, bmi->bmiHeader.biBitCount);
|
||||||
|
|
||||||
hSourceBitmap = EngCreateBitmap(SourceSize,
|
hSourceBitmap = EngCreateBitmap(SourceSize,
|
||||||
|
@ -556,6 +559,9 @@ NtGdiSetDIBitsToDeviceInternal(
|
||||||
EXLATEOBJ_vInitialize(&exlo, ppalDIB, ppalDDB, 0, 0, 0);
|
EXLATEOBJ_vInitialize(&exlo, ppalDIB, ppalDDB, 0, 0, 0);
|
||||||
|
|
||||||
/* Copy the bits */
|
/* 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,
|
Status = IntEngBitBlt(pDestSurf,
|
||||||
pSourceSurf,
|
pSourceSurf,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -574,8 +580,7 @@ NtGdiSetDIBitsToDeviceInternal(
|
||||||
Exit:
|
Exit:
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
/* FIXME: Should probably be only the number of lines actually copied */
|
ret = ScanLines;
|
||||||
ret = ScanLines; // this one --> abs(Info->bmiHeader.biHeight) - StartScan;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ppalDIB) PALETTE_UnlockPalette(ppalDIB);
|
if (ppalDIB) PALETTE_UnlockPalette(ppalDIB);
|
||||||
|
|
Loading…
Reference in a new issue