mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 01:25:41 +00:00
[WIN32K]
- Use DC_vPrepareDCsForBlit in DIB transfer functions, as per Timo's remarks. svn path=/trunk/; revision=57138
This commit is contained in:
parent
79c2bd51a0
commit
ae2e8ad562
1 changed files with 32 additions and 42 deletions
|
@ -445,27 +445,9 @@ NtGdiSetDIBitsToDeviceInternal(
|
|||
if (pDC->dctype == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(pDC);
|
||||
goto Exit2;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Select the right surface.
|
||||
* NOTE: we don't call DC_vPrepareDCsForBlit, because we don't
|
||||
* care about mouse, visible region or brushes in this API.
|
||||
*/
|
||||
if(pDC->dctype == DCTYPE_DIRECT)
|
||||
pSurf = pDC->ppdev->pSurface;
|
||||
else
|
||||
pSurf = pDC->dclevel.pSurface;
|
||||
if (!pSurf)
|
||||
{
|
||||
DC_UnlockDc(pDC);
|
||||
ret = ScanLines;
|
||||
goto Exit2;
|
||||
}
|
||||
|
||||
pDestSurf = &pSurf->SurfObj;
|
||||
|
||||
rcDest.left = XDest;
|
||||
rcDest.top = YDest;
|
||||
if (bTransformCoordinates)
|
||||
|
@ -510,8 +492,6 @@ NtGdiSetDIBitsToDeviceInternal(
|
|||
goto Exit;
|
||||
}
|
||||
|
||||
ASSERT(pSurf->ppal);
|
||||
|
||||
/* Create a palette for the DIB */
|
||||
ppalDIB = CreateDIBPalette(bmi, pDC, ColorUse);
|
||||
if (!ppalDIB)
|
||||
|
@ -521,6 +501,18 @@ NtGdiSetDIBitsToDeviceInternal(
|
|||
goto Exit;
|
||||
}
|
||||
|
||||
/* This is actually a blit */
|
||||
DC_vPrepareDCsForBlit(pDC, rcDest, NULL, rcDest);
|
||||
pSurf = pDC->dclevel.pSurface;
|
||||
if (!pSurf)
|
||||
{
|
||||
DC_vFinishBlit(pDC, NULL);
|
||||
ret = ScanLines;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
ASSERT(pSurf->ppal);
|
||||
|
||||
/* Initialize EXLATEOBJ */
|
||||
EXLATEOBJ_vInitialize(&exlo,
|
||||
ppalDIB,
|
||||
|
@ -529,6 +521,8 @@ NtGdiSetDIBitsToDeviceInternal(
|
|||
pDC->pdcattr->crBackgroundClr,
|
||||
pDC->pdcattr->crForegroundClr);
|
||||
|
||||
pDestSurf = &pSurf->SurfObj;
|
||||
|
||||
/* 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,
|
||||
|
@ -548,6 +542,9 @@ NtGdiSetDIBitsToDeviceInternal(
|
|||
/* Cleanup EXLATEOBJ */
|
||||
EXLATEOBJ_vCleanup(&exlo);
|
||||
|
||||
/* We're done */
|
||||
DC_vFinishBlit(pDC, NULL);
|
||||
|
||||
Exit:
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -1121,22 +1118,6 @@ NtGdiStretchDIBitsInternal(
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
/*
|
||||
* Select the right surface.
|
||||
* NOTE: we don't call DC_vPrepareDCsForBlit, because we don't
|
||||
* care about mouse, visible region or brushes in this API.
|
||||
*/
|
||||
if(pdc->dctype == DCTYPE_DIRECT)
|
||||
psurfDst = pdc->ppdev->pSurface;
|
||||
else
|
||||
psurfDst = pdc->dclevel.pSurface;
|
||||
if (!psurfDst)
|
||||
{
|
||||
// CHECKME
|
||||
bResult = TRUE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Calculate source and destination rect */
|
||||
rcSrc.left = xSrc;
|
||||
rcSrc.top = ySrc;
|
||||
|
@ -1180,6 +1161,18 @@ NtGdiStretchDIBitsInternal(
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Prepare DC for blit */
|
||||
DC_vPrepareDCsForBlit(pdc, rcDst, NULL, rcSrc);
|
||||
|
||||
psurfDst = pdc->dclevel.pSurface;
|
||||
if (!psurfDst)
|
||||
{
|
||||
DC_vFinishBlit(pdc, NULL);
|
||||
// CHECKME
|
||||
bResult = TRUE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Initialize XLATEOBJ */
|
||||
EXLATEOBJ_vInitialize(&exlo,
|
||||
ppalDIB,
|
||||
|
@ -1188,9 +1181,6 @@ NtGdiStretchDIBitsInternal(
|
|||
pdc->pdcattr->crBackgroundClr,
|
||||
pdc->pdcattr->crForegroundClr);
|
||||
|
||||
/* Prepare DC for blit */
|
||||
DC_vPrepareDCsForBlit(pdc, rcDst, NULL, rcSrc);
|
||||
|
||||
/* Perform the stretch operation */
|
||||
bResult = IntEngStretchBlt(&psurfDst->SurfObj,
|
||||
&psurfTmp->SurfObj,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue