Author: jgardou Date: Sun Apr 18 19:19:36 2010 New Revision: 46923
URL: http://svn.reactos.org/svn/reactos?rev=46923&view=rev Log: [WIN32K] - More DC_vPrepareDCsForBlit/DC_vFinishBlit with assorted MouseSafetyOnDrawEnd removals
Modified: branches/reactos-yarotows/subsystems/win32/win32k/eng/copybits.c branches/reactos-yarotows/subsystems/win32/win32k/eng/gradient.c branches/reactos-yarotows/subsystems/win32/win32k/eng/lineto.c branches/reactos-yarotows/subsystems/win32/win32k/ntuser/painting.c branches/reactos-yarotows/subsystems/win32/win32k/objects/arc.c branches/reactos-yarotows/subsystems/win32/win32k/objects/fillshap.c branches/reactos-yarotows/subsystems/win32/win32k/objects/line.c
Modified: branches/reactos-yarotows/subsystems/win32/win32k/eng/copybits.c URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win3... ============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/eng/copybits.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/eng/copybits.c [iso-8859-1] Sun Apr 18 19:19:36 2010 @@ -198,20 +198,7 @@ RECTL *prclDest, POINTL *ptlSource) { - BOOL bResult; - - MouseSafetyOnDrawStart(psoSource, ptlSource->x, ptlSource->y, - (ptlSource->x + abs(prclDest->right - prclDest->left)), - (ptlSource->y + abs(prclDest->bottom - prclDest->top))); - - MouseSafetyOnDrawStart(psoDest, prclDest->left, prclDest->top, prclDest->right, prclDest->bottom); - - bResult = EngCopyBits(psoDest, psoSource, pco, pxlo, prclDest, ptlSource); - - MouseSafetyOnDrawEnd(psoDest); - MouseSafetyOnDrawEnd(psoSource); - - return bResult; + return EngCopyBits(psoDest, psoSource, pco, pxlo, prclDest, ptlSource); }
Modified: branches/reactos-yarotows/subsystems/win32/win32k/eng/gradient.c URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win3... ============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/eng/gradient.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/eng/gradient.c [iso-8859-1] Sun Apr 18 19:19:36 2010 @@ -549,12 +549,6 @@ ASSERT(psurf);
SURFACE_LockBitmapBits(psurf); - MouseSafetyOnDrawStart( - psoDest, - pco->rclBounds.left, - pco->rclBounds.top, - pco->rclBounds.right, - pco->rclBounds.bottom); if(psurf->flHooks & HOOK_GRADIENTFILL) { Ret = GDIDEVFUNCS(psoDest).GradientFill( @@ -566,7 +560,6 @@ Ret = EngGradientFill(psoDest, pco, pxlo, pVertex, nVertex, pMesh, nMesh, prclExtents, pptlDitherOrg, ulMode); } - MouseSafetyOnDrawEnd(psoDest); SURFACE_UnlockBitmapBits(psurf);
return Ret;
Modified: branches/reactos-yarotows/subsystems/win32/win32k/eng/lineto.c URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win3... ============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/eng/lineto.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/eng/lineto.c [iso-8859-1] Sun Apr 18 19:19:36 2010 @@ -566,7 +566,6 @@ if (b.top == b.bottom) b.bottom++;
SURFACE_LockBitmapBits(psurfDest); - MouseSafetyOnDrawStart(psoDest, x1, y1, x2, y2);
if (psurfDest->flHooks & HOOK_LINETO) { @@ -587,7 +586,6 @@ ret = EngLineTo(psoDest, ClipObj, pbo, x1, y1, x2, y2, RectBounds, Mix); }
- MouseSafetyOnDrawEnd(psoDest); SURFACE_UnlockBitmapBits(psurfDest);
return ret;
Modified: branches/reactos-yarotows/subsystems/win32/win32k/ntuser/painting.c URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win3... ============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/ntuser/painting.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/ntuser/painting.c [iso-8859-1] Sun Apr 18 19:19:36 2010 @@ -1842,6 +1842,7 @@ goto cleanup; }
+ /* There is no need to call DC_vPrepareDCsForBlit for memory DC */ if(!IntGdiGradientFill(pMemDc, vert, 2, &gcap, 1, GRADIENT_FILL_RECT_H)) {
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/arc.c URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win3... ============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/objects/arc.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/objects/arc.c [iso-8859-1] Sun Apr 18 19:19:36 2010 @@ -31,7 +31,7 @@ static BOOL FASTCALL -IntArc( DC *dc, +IntArc( DC *dc, int Left, int Top, int Right, @@ -91,7 +91,7 @@ }
if (!PenWidth) PenWidth = 1; - pbrushPen->ptPenWidth.x = PenWidth; + pbrushPen->ptPenWidth.x = PenWidth;
RectBounds.left = Left; RectBounds.right = Right; @@ -105,7 +105,7 @@
IntLPtoDP(dc, (LPPOINT)&RectBounds, 2); IntLPtoDP(dc, (LPPOINT)&RectSEpts, 2); - + RectBounds.left += dc->ptlDCOrig.x; RectBounds.right += dc->ptlDCOrig.x; RectBounds.top += dc->ptlDCOrig.y; @@ -172,7 +172,7 @@ } if (arctype == GdiTypeChord) PUTLINE(EfCx + CenterX, EfCy + CenterY, SfCx + CenterX, SfCy + CenterY, dc->eboLine); - + pbrushPen->ptPenWidth.x = PenOrigWidth; PEN_UnlockPen(pbrushPen); DPRINT("IntArc Exit.\n"); @@ -329,7 +329,10 @@ } worker.l = dwStartAngle; worker1.l = dwSweepAngle; + DC_vPrepareDCsForBlit(pDC, pDC->rosdc.CombinedClip->rclBounds, + NULL, pDC->rosdc.CombinedClip->rclBounds); Ret = IntGdiAngleArc( pDC, x, y, dwRadius, worker.f, worker1.f); + DC_vFinishBlit(pDC, NULL); DC_UnlockDc( pDC ); return Ret; } @@ -364,6 +367,9 @@ return TRUE; }
+ DC_vPrepareDCsForBlit(dc, dc->rosdc.CombinedClip->rclBounds, + NULL, dc->rosdc.CombinedClip->rclBounds); + Ret = IntGdiArcInternal( arctype, dc, @@ -376,6 +382,7 @@ XEndArc, YEndArc);
+ DC_vFinishBlit(dc, NULL); DC_UnlockDc( dc ); return Ret; }
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/fillshap.c URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win3... ============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/objects/fillshap.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/objects/fillshap.c [iso-8859-1] Sun Apr 18 19:19:36 2010 @@ -110,7 +110,7 @@ psurf, &dc->eboFill.BrushObject, Points, - Count, + Count, DestRect, &BrushOrigin); } @@ -271,15 +271,15 @@ }
if (!PenWidth) PenWidth = 1; - pbrush->ptPenWidth.x = PenWidth; + pbrush->ptPenWidth.x = PenWidth;
RectBounds.left = Left; RectBounds.right = Right; RectBounds.top = Top; RectBounds.bottom = Bottom; - + IntLPtoDP(dc, (LPPOINT)&RectBounds, 2); - + RectBounds.left += dc->ptlDCOrig.x; RectBounds.right += dc->ptlDCOrig.x; RectBounds.top += dc->ptlDCOrig.y; @@ -298,7 +298,7 @@ CenterX - RadiusX, CenterY + RadiusY, RadiusX*2, RadiusY*2);
pFillBrushObj = BRUSH_LockBrush(pdcattr->hbrush); - if (NULL == pFillBrushObj) + if (NULL == pFillBrushObj) { DPRINT1("FillEllipse Fail\n"); SetLastWin32Error(ERROR_INTERNAL_ERROR); @@ -477,6 +477,9 @@ /* Yes, Windows really returns TRUE in this case */ return TRUE; } + + DC_vPrepareDCsForBlit(dc, dc->rosdc.CombinedClip->rclBounds, + NULL, dc->rosdc.CombinedClip->rclBounds);
/* Perform the actual work */ switch (iFunc) @@ -502,6 +505,7 @@ }
/* Cleanup and return */ + DC_vFinishBlit(dc, NULL); DC_UnlockDc(dc); ExFreePool(pTemp);
@@ -661,6 +665,7 @@ { DC *dc; BOOL ret; // default to failure + RECT rect = {LeftRect, TopRect, RightRect, BottomRect} ;
dc = DC_LockDc(hDC); if (!dc) @@ -675,7 +680,9 @@ return TRUE; }
+ DC_vPrepareDCsForBlit(dc, rect, NULL, rect); ret = IntRectangle ( dc, LeftRect, TopRect, RightRect, BottomRect ); + DC_vFinishBlit(dc, NULL); DC_UnlockDc ( dc );
return ret; @@ -750,7 +757,7 @@ }
if (!PenWidth) PenWidth = 1; - pbrushLine->ptPenWidth.x = PenWidth; + pbrushLine->ptPenWidth.x = PenWidth;
RectBounds.left = Left; RectBounds.top = Top; @@ -765,12 +772,12 @@ RectBounds.bottom += dc->ptlDCOrig.y;
pbrushFill = BRUSH_LockBrush(pdcattr->hbrush); - if (NULL == pbrushFill) + if (NULL == pbrushFill) { DPRINT1("FillRound Fail\n"); SetLastWin32Error(ERROR_INTERNAL_ERROR); ret = FALSE; - } + } else { RtlCopyMemory(&brushTemp, pbrushFill, sizeof(brushTemp)); @@ -1048,8 +1055,12 @@ return FALSE; }
+ DC_vPrepareDCsForBlit(dc, dc->rosdc.CombinedClip->rclBounds, + NULL, dc->rosdc.CombinedClip->rclBounds); + Ret = IntGdiGradientFill(dc, SafeVertex, uVertex, SafeMesh, uMesh, ulMode);
+ DC_vFinishBlit(dc, NULL) ; DC_UnlockDc(dc); ExFreePool(SafeVertex); return Ret; @@ -1115,7 +1126,7 @@ hpal = dc->dclevel.pSurface->hDIBPalette; if (!hpal) hpal = pPrimarySurface->devinfo.hpalDefault; ppal = PALETTE_ShareLockPalette(hpal); - + EXLATEOBJ_vInitialize(&exlo, &gpalRGB, ppal, 0, 0xffffff, 0);
/* Only solid fills supported for now
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/line.c URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win3... ============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/objects/line.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/objects/line.c [iso-8859-1] Sun Apr 18 19:19:36 2010 @@ -265,6 +265,8 @@ Points = EngAllocMem(0, Count * sizeof(POINT), TAG_COORD); if (Points != NULL) { + DC_vPrepareDCsForBlit(dc, dc->rosdc.CombinedClip->rclBounds, + NULL, dc->rosdc.CombinedClip->rclBounds); psurf = dc->dclevel.pSurface; /* FIXME - psurf can be NULL!!!! Don't assert but handle this case gracefully! */ @@ -288,6 +290,7 @@ ROP2_TO_MIX(pdcattr->jROP2));
EngFreeMem(Points); + DC_vFinishBlit(dc, NULL); } else { @@ -376,6 +379,7 @@ { DC *dc; BOOL Ret; + RECT rcLockRect ;
dc = DC_LockDc(hDC); if (!dc) @@ -390,7 +394,24 @@ return TRUE; }
+ rcLockRect.left = dc->pdcattr->ptlCurrent.x; + rcLockRect.top = dc->pdcattr->ptlCurrent.y; + rcLockRect.right = XEnd; + rcLockRect.bottom = YEnd; + + IntLPtoDP(dc, &rcLockRect, 2); + + /* The DCOrg is in device coordinates */ + rcLockRect.left += dc->ptlDCOrig.x; + rcLockRect.top += dc->ptlDCOrig.y; + rcLockRect.right += dc->ptlDCOrig.x; + rcLockRect.bottom += dc->ptlDCOrig.y; + + DC_vPrepareDCsForBlit(dc, rcLockRect, NULL, rcLockRect); + Ret = IntGdiLineTo(dc, XEnd, YEnd); + + DC_vFinishBlit(dc, NULL);
DC_UnlockDc(dc); return Ret; @@ -414,6 +435,8 @@ dc = DC_LockDc(hdc); if (!dc) return FALSE; pdcattr = dc->pdcattr; + DC_vPrepareDCsForBlit(dc, dc->rosdc.CombinedClip->rclBounds, + NULL, dc->rosdc.CombinedClip->rclBounds);
_SEH2_TRY { @@ -480,6 +503,7 @@ } _SEH2_END;
+ DC_vFinishBlit(dc, NULL); DC_UnlockDc(dc);
return result;