mirror of
https://github.com/reactos/reactos.git
synced 2025-05-07 02:41:22 +00:00
[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. svn path=/branches/reactos-yarotows/; revision=46964
This commit is contained in:
parent
75f07ae3b4
commit
650b476440
3 changed files with 28 additions and 32 deletions
|
@ -229,9 +229,6 @@ NtGdiBitBlt(
|
||||||
|
|
||||||
pdcattr = DCDest->pdcattr;
|
pdcattr = DCDest->pdcattr;
|
||||||
|
|
||||||
if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
|
|
||||||
DC_vUpdateFillBrush(DCDest);
|
|
||||||
|
|
||||||
DestRect.left = XDest;
|
DestRect.left = XDest;
|
||||||
DestRect.top = YDest;
|
DestRect.top = YDest;
|
||||||
DestRect.right = XDest+Width;
|
DestRect.right = XDest+Width;
|
||||||
|
@ -262,6 +259,9 @@ NtGdiBitBlt(
|
||||||
/* Prepare blit */
|
/* Prepare blit */
|
||||||
DC_vPrepareDCsForBlit(DCDest, DestRect, DCSrc, SourceRect);
|
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 */
|
/* Determine surfaces to be used in the bitblt */
|
||||||
BitmapDest = DCDest->dclevel.pSurface;
|
BitmapDest = DCDest->dclevel.pSurface;
|
||||||
if (!BitmapDest)
|
if (!BitmapDest)
|
||||||
|
@ -781,9 +781,6 @@ GreStretchBltMask(
|
||||||
|
|
||||||
pdcattr = DCDest->pdcattr;
|
pdcattr = DCDest->pdcattr;
|
||||||
|
|
||||||
if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
|
|
||||||
DC_vUpdateFillBrush(DCDest);
|
|
||||||
|
|
||||||
DestRect.left = XOriginDest;
|
DestRect.left = XOriginDest;
|
||||||
DestRect.top = YOriginDest;
|
DestRect.top = YOriginDest;
|
||||||
DestRect.right = XOriginDest+WidthDest;
|
DestRect.right = XOriginDest+WidthDest;
|
||||||
|
@ -816,6 +813,9 @@ GreStretchBltMask(
|
||||||
/* Only prepare Source and Dest, hdcMask represents a DIB */
|
/* Only prepare Source and Dest, hdcMask represents a DIB */
|
||||||
DC_vPrepareDCsForBlit(DCDest, DestRect, DCSrc, SourceRect);
|
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 */
|
/* Determine surfaces to be used in the bitblt */
|
||||||
BitmapDest = DCDest->dclevel.pSurface;
|
BitmapDest = DCDest->dclevel.pSurface;
|
||||||
if (BitmapDest == NULL)
|
if (BitmapDest == NULL)
|
||||||
|
@ -936,7 +936,6 @@ IntPatBlt(
|
||||||
{
|
{
|
||||||
RECTL DestRect;
|
RECTL DestRect;
|
||||||
SURFACE *psurf;
|
SURFACE *psurf;
|
||||||
EBRUSHOBJ eboFill;
|
|
||||||
POINTL BrushOrigin;
|
POINTL BrushOrigin;
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
|
||||||
|
@ -983,7 +982,8 @@ IntPatBlt(
|
||||||
|
|
||||||
psurf = pdc->dclevel.pSurface;
|
psurf = pdc->dclevel.pSurface;
|
||||||
|
|
||||||
EBRUSHOBJ_vInit(&eboFill, pbrush, pdc);
|
if (pdc->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
|
||||||
|
DC_vUpdateFillBrush(pdc);
|
||||||
|
|
||||||
ret = IntEngBitBlt(
|
ret = IntEngBitBlt(
|
||||||
&psurf->SurfObj,
|
&psurf->SurfObj,
|
||||||
|
@ -994,12 +994,10 @@ IntPatBlt(
|
||||||
&DestRect,
|
&DestRect,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&eboFill.BrushObject, // use pDC->eboFill
|
&pdc->eboFill.BrushObject,
|
||||||
&BrushOrigin,
|
&BrushOrigin,
|
||||||
ROP3_TO_ROP4(dwRop));
|
ROP3_TO_ROP4(dwRop));
|
||||||
|
|
||||||
EBRUSHOBJ_vCleanup(&eboFill);
|
|
||||||
|
|
||||||
DC_vFinishBlit(pdc, NULL);
|
DC_vFinishBlit(pdc, NULL);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -478,15 +478,8 @@ DC_vUpdateDC(PDC pdc)
|
||||||
pdc->flGraphicsCaps = ppdev->devinfo.flGraphicsCaps;
|
pdc->flGraphicsCaps = ppdev->devinfo.flGraphicsCaps;
|
||||||
pdc->flGraphicsCaps2 = ppdev->devinfo.flGraphicsCaps2;
|
pdc->flGraphicsCaps2 = ppdev->devinfo.flGraphicsCaps2;
|
||||||
|
|
||||||
/* re-Initialize EBRUSHOBJs */
|
/* Mark EBRUSHOBJs as dirty */
|
||||||
EBRUSHOBJ_vCleanup(&pdc->eboFill);
|
pdc->pdcattr->ulDirty_ |= DIRTY_DEFAULT ;
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Prepare a blit for up to 2 DCs */
|
/* Prepare a blit for up to 2 DCs */
|
||||||
|
|
|
@ -3153,7 +3153,7 @@ GreExtTextOutW(
|
||||||
LONGLONG TextLeft, RealXStart;
|
LONGLONG TextLeft, RealXStart;
|
||||||
ULONG TextTop, previous, BackgroundLeft;
|
ULONG TextTop, previous, BackgroundLeft;
|
||||||
FT_Bool use_kerning;
|
FT_Bool use_kerning;
|
||||||
RECTL DestRect, MaskRect;
|
RECTL DestRect, MaskRect, DummyRect = {0, 0, 0, 0};
|
||||||
POINTL SourcePoint, BrushOrigin;
|
POINTL SourcePoint, BrushOrigin;
|
||||||
HBITMAP HSourceGlyph;
|
HBITMAP HSourceGlyph;
|
||||||
SURFOBJ *SourceGlyphSurf;
|
SURFOBJ *SourceGlyphSurf;
|
||||||
|
@ -3189,9 +3189,6 @@ GreExtTextOutW(
|
||||||
|
|
||||||
pdcattr = dc->pdcattr;
|
pdcattr = dc->pdcattr;
|
||||||
|
|
||||||
if (pdcattr->ulDirty_ & DIRTY_TEXT)
|
|
||||||
DC_vUpdateTextBrush(dc);
|
|
||||||
|
|
||||||
if ((fuOptions & ETO_OPAQUE) || pdcattr->jBkMode == OPAQUE)
|
if ((fuOptions & ETO_OPAQUE) || pdcattr->jBkMode == OPAQUE)
|
||||||
{
|
{
|
||||||
if (pdcattr->ulDirty_ & DIRTY_BACKGROUND)
|
if (pdcattr->ulDirty_ & DIRTY_BACKGROUND)
|
||||||
|
@ -3225,13 +3222,6 @@ GreExtTextOutW(
|
||||||
IntLPtoDP(dc, (POINT *)lprc, 2);
|
IntLPtoDP(dc, (POINT *)lprc, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
psurf = dc->dclevel.pSurface;
|
|
||||||
if (!psurf)
|
|
||||||
{
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
SurfObj = &psurf->SurfObj;
|
|
||||||
|
|
||||||
Start.x = XStart;
|
Start.x = XStart;
|
||||||
Start.y = YStart;
|
Start.y = YStart;
|
||||||
IntLPtoDP(dc, &Start, 1);
|
IntLPtoDP(dc, &Start, 1);
|
||||||
|
@ -3262,8 +3252,11 @@ GreExtTextOutW(
|
||||||
|
|
||||||
DC_vPrepareDCsForBlit(dc, DestRect, NULL, DestRect);
|
DC_vPrepareDCsForBlit(dc, DestRect, NULL, DestRect);
|
||||||
|
|
||||||
|
if (pdcattr->ulDirty_ & DIRTY_BACKGROUND)
|
||||||
|
DC_vUpdateBackgroundBrush(dc);
|
||||||
|
|
||||||
IntEngBitBlt(
|
IntEngBitBlt(
|
||||||
&psurf->SurfObj,
|
&dc->dclevel.pSurface->SurfObj,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
dc->rosdc.CombinedClip,
|
dc->rosdc.CombinedClip,
|
||||||
|
@ -3440,6 +3433,12 @@ GreExtTextOutW(
|
||||||
TextTop = YStart;
|
TextTop = YStart;
|
||||||
BackgroundLeft = (RealXStart + 32) >> 6;
|
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 */
|
/* Create the xlateobj */
|
||||||
hDestPalette = psurf->hDIBPalette;
|
hDestPalette = psurf->hDIBPalette;
|
||||||
if (!hDestPalette) hDestPalette = pPrimarySurface->devinfo.hpalDefault;
|
if (!hDestPalette) hDestPalette = pPrimarySurface->devinfo.hpalDefault;
|
||||||
|
@ -3450,6 +3449,11 @@ GreExtTextOutW(
|
||||||
EXLATEOBJ_vInitialize(&exloDst2RGB, ppalDst, &gpalRGB, 0, 0, 0);
|
EXLATEOBJ_vInitialize(&exloDst2RGB, ppalDst, &gpalRGB, 0, 0, 0);
|
||||||
PALETTE_UnlockPalette(ppalDst);
|
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.
|
* The main rendering loop.
|
||||||
|
@ -3613,6 +3617,7 @@ GreExtTextOutW(
|
||||||
}
|
}
|
||||||
IntUnLockFreeType;
|
IntUnLockFreeType;
|
||||||
|
|
||||||
|
DC_vFinishBlit(dc, NULL) ;
|
||||||
EXLATEOBJ_vCleanup(&exloRGB2Dst);
|
EXLATEOBJ_vCleanup(&exloRGB2Dst);
|
||||||
EXLATEOBJ_vCleanup(&exloDst2RGB);
|
EXLATEOBJ_vCleanup(&exloDst2RGB);
|
||||||
if (TextObj != NULL)
|
if (TextObj != NULL)
|
||||||
|
|
Loading…
Reference in a new issue