- Use DC_vPrepareDCsForBlit in DIB transfer functions, as per Timo's remarks.

svn path=/trunk/; revision=57138
This commit is contained in:
Jérôme Gardou 2012-08-22 20:11:41 +00:00
parent 79c2bd51a0
commit ae2e8ad562

View file

@ -445,27 +445,9 @@ NtGdiSetDIBitsToDeviceInternal(
if (pDC->dctype == DC_TYPE_INFO) if (pDC->dctype == DC_TYPE_INFO)
{ {
DC_UnlockDc(pDC); 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.left = XDest;
rcDest.top = YDest; rcDest.top = YDest;
if (bTransformCoordinates) if (bTransformCoordinates)
@ -510,8 +492,6 @@ NtGdiSetDIBitsToDeviceInternal(
goto Exit; goto Exit;
} }
ASSERT(pSurf->ppal);
/* Create a palette for the DIB */ /* Create a palette for the DIB */
ppalDIB = CreateDIBPalette(bmi, pDC, ColorUse); ppalDIB = CreateDIBPalette(bmi, pDC, ColorUse);
if (!ppalDIB) if (!ppalDIB)
@ -521,6 +501,18 @@ NtGdiSetDIBitsToDeviceInternal(
goto Exit; 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 */ /* Initialize EXLATEOBJ */
EXLATEOBJ_vInitialize(&exlo, EXLATEOBJ_vInitialize(&exlo,
ppalDIB, ppalDIB,
@ -529,6 +521,8 @@ NtGdiSetDIBitsToDeviceInternal(
pDC->pdcattr->crBackgroundClr, pDC->pdcattr->crBackgroundClr,
pDC->pdcattr->crForegroundClr); pDC->pdcattr->crForegroundClr);
pDestSurf = &pSurf->SurfObj;
/* Copy the bits */ /* Copy the bits */
DPRINT("BitsToDev with dstsurf=(%d|%d) (%d|%d), src=(%d|%d) w=%d h=%d\n", DPRINT("BitsToDev with dstsurf=(%d|%d) (%d|%d), src=(%d|%d) w=%d h=%d\n",
rcDest.left, rcDest.top, rcDest.right, rcDest.bottom, rcDest.left, rcDest.top, rcDest.right, rcDest.bottom,
@ -548,6 +542,9 @@ NtGdiSetDIBitsToDeviceInternal(
/* Cleanup EXLATEOBJ */ /* Cleanup EXLATEOBJ */
EXLATEOBJ_vCleanup(&exlo); EXLATEOBJ_vCleanup(&exlo);
/* We're done */
DC_vFinishBlit(pDC, NULL);
Exit: Exit:
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))
{ {
@ -1121,22 +1118,6 @@ NtGdiStretchDIBitsInternal(
goto cleanup; 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 */ /* Calculate source and destination rect */
rcSrc.left = xSrc; rcSrc.left = xSrc;
rcSrc.top = ySrc; rcSrc.top = ySrc;
@ -1180,6 +1161,18 @@ NtGdiStretchDIBitsInternal(
goto cleanup; 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 */ /* Initialize XLATEOBJ */
EXLATEOBJ_vInitialize(&exlo, EXLATEOBJ_vInitialize(&exlo,
ppalDIB, ppalDIB,
@ -1188,9 +1181,6 @@ NtGdiStretchDIBitsInternal(
pdc->pdcattr->crBackgroundClr, pdc->pdcattr->crBackgroundClr,
pdc->pdcattr->crForegroundClr); pdc->pdcattr->crForegroundClr);
/* Prepare DC for blit */
DC_vPrepareDCsForBlit(pdc, rcDst, NULL, rcSrc);
/* Perform the stretch operation */ /* Perform the stretch operation */
bResult = IntEngStretchBlt(&psurfDst->SurfObj, bResult = IntEngStretchBlt(&psurfDst->SurfObj,
&psurfTmp->SurfObj, &psurfTmp->SurfObj,