Author: jgardou Date: Tue Apr 20 21:31:45 2010 New Revision: 46964
URL: http://svn.reactos.org/svn/reactos?rev=46964&view=rev Log: [WIN32K] - Revert r46960 : the correct way to go is to mark brushes as dirty and update them where needed - Do so in GreExtTextOutW, NtGdiBitBlt, NtGdiStrecthBltMask and IntPatBlt - Add a small hack to GreEstTextOutW so we hold the Blit lock when needed without too much pain.
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/bitblt.c branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c branches/reactos-yarotows/subsystems/win32/win32k/objects/freetype.c
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/bitblt.c URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win3... ============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1] Tue Apr 20 21:31:45 2010 @@ -229,9 +229,6 @@
pdcattr = DCDest->pdcattr;
- if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) - DC_vUpdateFillBrush(DCDest); - DestRect.left = XDest; DestRect.top = YDest; DestRect.right = XDest+Width; @@ -261,6 +258,9 @@
/* 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; @@ -781,9 +781,6 @@
pdcattr = DCDest->pdcattr;
- if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) - DC_vUpdateFillBrush(DCDest); - DestRect.left = XOriginDest; DestRect.top = YOriginDest; DestRect.right = XOriginDest+WidthDest; @@ -815,6 +812,9 @@
/* 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; @@ -936,7 +936,6 @@ { RECTL DestRect; SURFACE *psurf; - EBRUSHOBJ eboFill; POINTL BrushOrigin; BOOL ret;
@@ -983,7 +982,8 @@
psurf = pdc->dclevel.pSurface;
- EBRUSHOBJ_vInit(&eboFill, pbrush, pdc); + if (pdc->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) + DC_vUpdateFillBrush(pdc);
ret = IntEngBitBlt( &psurf->SurfObj, @@ -994,11 +994,9 @@ &DestRect, NULL, NULL, - &eboFill.BrushObject, // use pDC->eboFill + &pdc->eboFill.BrushObject, &BrushOrigin, ROP3_TO_ROP4(dwRop)); - - EBRUSHOBJ_vCleanup(&eboFill);
DC_vFinishBlit(pdc, NULL);
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win3... ============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] Tue Apr 20 21:31:45 2010 @@ -478,15 +478,8 @@ pdc->flGraphicsCaps = ppdev->devinfo.flGraphicsCaps; pdc->flGraphicsCaps2 = ppdev->devinfo.flGraphicsCaps2;
- /* re-Initialize EBRUSHOBJs */ - EBRUSHOBJ_vCleanup(&pdc->eboFill); - EBRUSHOBJ_vInit(&pdc->eboFill, pdc->dclevel.pbrFill, pdc); - EBRUSHOBJ_vCleanup(&pdc->eboLine); - EBRUSHOBJ_vInit(&pdc->eboLine, pdc->dclevel.pbrLine, pdc); - EBRUSHOBJ_vCleanup(&pdc->eboText); - EBRUSHOBJ_vInit(&pdc->eboText, pbrDefaultBrush, pdc); - EBRUSHOBJ_vCleanup(&pdc->eboBackground); - EBRUSHOBJ_vInit(&pdc->eboBackground, pbrDefaultBrush, pdc); + /* Mark EBRUSHOBJs as dirty */ + pdc->pdcattr->ulDirty_ |= DIRTY_DEFAULT ; }
/* Prepare a blit for up to 2 DCs */
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/freetype.c URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win3... ============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] Tue Apr 20 21:31:45 2010 @@ -3153,7 +3153,7 @@ LONGLONG TextLeft, RealXStart; ULONG TextTop, previous, BackgroundLeft; FT_Bool use_kerning; - RECTL DestRect, MaskRect; + RECTL DestRect, MaskRect, DummyRect = {0, 0, 0, 0}; POINTL SourcePoint, BrushOrigin; HBITMAP HSourceGlyph; SURFOBJ *SourceGlyphSurf; @@ -3189,9 +3189,6 @@
pdcattr = dc->pdcattr;
- if (pdcattr->ulDirty_ & DIRTY_TEXT) - DC_vUpdateTextBrush(dc); - if ((fuOptions & ETO_OPAQUE) || pdcattr->jBkMode == OPAQUE) { if (pdcattr->ulDirty_ & DIRTY_BACKGROUND) @@ -3225,13 +3222,6 @@ IntLPtoDP(dc, (POINT *)lprc, 2); }
- psurf = dc->dclevel.pSurface; - if (!psurf) - { - goto fail; - } - SurfObj = &psurf->SurfObj; - Start.x = XStart; Start.y = YStart; IntLPtoDP(dc, &Start, 1); @@ -3262,8 +3252,11 @@
DC_vPrepareDCsForBlit(dc, DestRect, NULL, DestRect);
+ if (pdcattr->ulDirty_ & DIRTY_BACKGROUND) + DC_vUpdateBackgroundBrush(dc); + IntEngBitBlt( - &psurf->SurfObj, + &dc->dclevel.pSurface->SurfObj, NULL, NULL, dc->rosdc.CombinedClip, @@ -3440,6 +3433,12 @@ TextTop = YStart; BackgroundLeft = (RealXStart + 32) >> 6;
+ /* Lock blit with a dummy rect */ + DC_vPrepareDCsForBlit(dc, DummyRect, NULL, DummyRect); + + psurf = dc->dclevel.pSurface ; + SurfObj = &psurf->SurfObj ; + /* Create the xlateobj */ hDestPalette = psurf->hDIBPalette; if (!hDestPalette) hDestPalette = pPrimarySurface->devinfo.hpalDefault; @@ -3450,6 +3449,11 @@ EXLATEOBJ_vInitialize(&exloDst2RGB, ppalDst, &gpalRGB, 0, 0, 0); PALETTE_UnlockPalette(ppalDst);
+ if ((fuOptions & ETO_OPAQUE) && (dc->pdcattr->ulDirty_ & DIRTY_BACKGROUND)) + DC_vUpdateBackgroundBrush(dc) ; + + if(dc->pdcattr->ulDirty_ & DIRTY_TEXT) + DC_vUpdateTextBrush(dc) ;
/* * The main rendering loop. @@ -3613,6 +3617,7 @@ } IntUnLockFreeType;
+ DC_vFinishBlit(dc, NULL) ; EXLATEOBJ_vCleanup(&exloRGB2Dst); EXLATEOBJ_vCleanup(&exloDst2RGB); if (TextObj != NULL)