pdcattr = DCDest->pdcattr;
- if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
- DC_vUpdateFillBrush(DCDest);
-
DestRect.left = XDest;
DestRect.top = YDest;
DestRect.right = XDest+Width;
/* Prepare blit */
DC_vPrepareDCsForBlit(DCDest, DestRect, DCSrc, SourceRect);
+ if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
+ DC_vUpdateFillBrush(DCDest);
+
/* Determine surfaces to be used in the bitblt */
BitmapDest = DCDest->dclevel.pSurface;
if (!BitmapDest)
PDC DCDest;
PDC DCSrc = NULL;
PDC DCMask = NULL;
+ HDC ahDC[3];
+ PGDIOBJ apObj[3];
PDC_ATTR pdcattr;
SURFACE *BitmapDest, *BitmapSrc = NULL;
SURFACE *BitmapMask = NULL;
return FALSE;
}
- DCDest = DC_LockDc(hDCDest);
+ DPRINT("Locking DCs\n");
+ ahDC[0] = hDCDest;
+ ahDC[1] = hDCSrc ;
+ ahDC[2] = hDCMask ;
+ GDIOBJ_LockMultipleObjs(3, ahDC, apObj);
+ DCDest = apObj[0];
+ DCSrc = apObj[1];
+ DCMask = apObj[2];
+
if (NULL == DCDest)
{
- DPRINT1("Invalid destination dc handle (0x%08x) passed to NtGdiStretchBlt\n", hDCDest);
- SetLastWin32Error(ERROR_INVALID_HANDLE);
+ if(DCSrc) GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject);
+ if(DCMask) GDIOBJ_UnlockObjByPtr(&DCMask->BaseObject);
+ DPRINT("Invalid destination dc handle (0x%08x) passed to NtGdiBitBlt\n", hDCDest);
return FALSE;
}
if (DCDest->dctype == DC_TYPE_INFO)
{
- DC_UnlockDc(DCDest);
+ if(DCSrc) GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject);
+ if(DCMask) GDIOBJ_UnlockObjByPtr(&DCMask->BaseObject);
+ GDIOBJ_UnlockObjByPtr(&DCDest->BaseObject);
/* Yes, Windows really returns TRUE in this case */
return TRUE;
}
if (UsesSource)
{
- if (hDCSrc != hDCDest)
+ if (NULL == DCSrc)
{
- DCSrc = DC_LockDc(hDCSrc);
- if (NULL == DCSrc)
- {
- DC_UnlockDc(DCDest);
- DPRINT1("Invalid source dc handle (0x%08x) passed to NtGdiStretchBlt\n", hDCSrc);
- SetLastWin32Error(ERROR_INVALID_HANDLE);
- return FALSE;
- }
- if (DCSrc->dctype == DC_TYPE_INFO)
- {
- DC_UnlockDc(DCSrc);
- DC_UnlockDc(DCDest);
- /* Yes, Windows really returns TRUE in this case */
- return TRUE;
- }
+ GDIOBJ_UnlockObjByPtr(&DCDest->BaseObject);
+ if(DCMask) GDIOBJ_UnlockObjByPtr(&DCMask->BaseObject);
+ DPRINT("Invalid source dc handle (0x%08x) passed to NtGdiBitBlt\n", hDCSrc);
+ return FALSE;
}
- else
+ if (DCSrc->dctype == DC_TYPE_INFO)
{
- DCSrc = DCDest;
+ GDIOBJ_UnlockObjByPtr(&DCDest->BaseObject);
+ GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject);
+ if(DCMask) GDIOBJ_UnlockObjByPtr(&DCMask->BaseObject);
+ /* Yes, Windows really returns TRUE in this case */
+ return TRUE;
}
}
+ else if(DCSrc)
+ {
+ DPRINT1("Getting a valid Source handle without using source!!!");
+ GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject);
+ DCSrc = NULL ;
+ }
pdcattr = DCDest->pdcattr;
- if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
- DC_vUpdateFillBrush(DCDest);
-
DestRect.left = XOriginDest;
DestRect.top = YOriginDest;
DestRect.right = XOriginDest+WidthDest;
BrushOrigin.x = 0;
BrushOrigin.y = 0;
+ /* Only prepare Source and Dest, hdcMask represents a DIB */
+ DC_vPrepareDCsForBlit(DCDest, DestRect, DCSrc, SourceRect);
+
+ if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
+ DC_vUpdateFillBrush(DCDest);
+
/* Determine surfaces to be used in the bitblt */
BitmapDest = DCDest->dclevel.pSurface;
if (BitmapDest == NULL)
BrushOrigin.y += DCDest->ptlDCOrig.y;
/* Make mask surface for source surface */
- if (BitmapSrc && hDCMask)
+ if (BitmapSrc && DCMask)
{
- DCMask = DC_LockDc(hDCMask);
- if (DCMask)
+ BitmapMask = DCMask->dclevel.pSurface;
+ if (BitmapMask &&
+ (BitmapMask->SurfObj.sizlBitmap.cx < WidthSrc ||
+ BitmapMask->SurfObj.sizlBitmap.cy < HeightSrc))
{
- BitmapMask = DCMask->dclevel.pSurface;
- if (BitmapMask &&
- (BitmapMask->SurfObj.sizlBitmap.cx < WidthSrc ||
- BitmapMask->SurfObj.sizlBitmap.cy < HeightSrc))
- {
- DPRINT1("%dx%d mask is smaller than %dx%d bitmap\n",
- BitmapMask->SurfObj.sizlBitmap.cx, BitmapMask->SurfObj.sizlBitmap.cy,
- WidthSrc, HeightSrc);
- goto failed;
- }
- /* Create mask offset point */
- MaskPoint.x = XOriginMask;
- MaskPoint.y = YOriginMask;
- IntLPtoDP(DCMask, &MaskPoint, 1);
- MaskPoint.x += DCMask->ptlDCOrig.x;
- MaskPoint.y += DCMask->ptlDCOrig.x;
+ DPRINT1("%dx%d mask is smaller than %dx%d bitmap\n",
+ BitmapMask->SurfObj.sizlBitmap.cx, BitmapMask->SurfObj.sizlBitmap.cy,
+ WidthSrc, HeightSrc);
+ EXLATEOBJ_vCleanup(&exlo);
+ goto failed;
}
+ /* Create mask offset point */
+ MaskPoint.x = XOriginMask;
+ MaskPoint.y = YOriginMask;
+ IntLPtoDP(DCMask, &MaskPoint, 1);
+ MaskPoint.x += DCMask->ptlDCOrig.x;
+ MaskPoint.y += DCMask->ptlDCOrig.x;
}
/* Perform the bitblt operation */
&DCDest->eboFill.BrushObject,
&BrushOrigin,
ROP3_TO_ROP4(ROP));
-
-failed:
if (UsesSource)
{
EXLATEOBJ_vCleanup(&exlo);
}
- if (UsesSource && hDCSrc != hDCDest)
+
+failed:
+ DC_vFinishBlit(DCDest, DCSrc);
+ if (UsesSource)
{
DC_UnlockDc(DCSrc);
}
{
RECTL DestRect;
SURFACE *psurf;
- EBRUSHOBJ eboFill;
POINTL BrushOrigin;
BOOL ret;
ASSERT(pbrush);
- psurf = pdc->dclevel.pSurface;
- if (psurf == NULL)
- {
- SetLastWin32Error(ERROR_INVALID_HANDLE);
- return FALSE;
- }
-
if (pbrush->flAttrs & GDIBRUSH_IS_NULL)
{
return TRUE;
BrushOrigin.x = pbrush->ptOrigin.x + pdc->ptlDCOrig.x;
BrushOrigin.y = pbrush->ptOrigin.y + pdc->ptlDCOrig.y;
- EBRUSHOBJ_vInit(&eboFill, pbrush, pdc);
-
DC_vPrepareDCsForBlit(pdc, DestRect, NULL, DestRect);
+ psurf = pdc->dclevel.pSurface;
+
+ if (pdc->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
+ DC_vUpdateFillBrush(pdc);
+
ret = IntEngBitBlt(
&psurf->SurfObj,
NULL,
&DestRect,
NULL,
NULL,
- &eboFill.BrushObject, // use pDC->eboFill
+ &pdc->eboFill.BrushObject,
&BrushOrigin,
ROP3_TO_ROP4(dwRop));
- EBRUSHOBJ_vCleanup(&eboFill);
-
DC_vFinishBlit(pdc, NULL);
return ret;