[NtGDI] Adding Support for Viewport TextOut

Add Viewport changes to Text Out Batch.
This commit is contained in:
jimtabor 2019-05-02 10:11:11 -05:00
parent dcaaf3e7af
commit 04a04659da

View file

@ -246,12 +246,13 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
PGDIBSTEXTOUT pgO; PGDIBSTEXTOUT pgO;
COLORREF crColor = -1, crBkColor; COLORREF crColor = -1, crBkColor;
ULONG ulForegroundClr, ulBackgroundClr; ULONG ulForegroundClr, ulBackgroundClr;
DWORD flags = 0, saveflags; DWORD flags = 0, flXform = 0, saveflags, saveflXform = 0;
FLONG flTextAlign = -1; FLONG flTextAlign = -1;
HANDLE hlfntNew; HANDLE hlfntNew;
PRECTL lprc; PRECTL lprc;
USHORT jBkMode; USHORT jBkMode;
LONG lBkMode; LONG lBkMode;
POINTL ptlViewportOrg;
if (!dc) break; if (!dc) break;
pgO = (PGDIBSTEXTOUT) pHdr; pgO = (PGDIBSTEXTOUT) pHdr;
@ -288,6 +289,15 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
flags |= DIRTY_CHARSET; flags |= DIRTY_CHARSET;
} }
if ( dc->pdcattr->ptlViewportOrg.x != pgO->ptlViewportOrg.x ||
dc->pdcattr->ptlViewportOrg.y != pgO->ptlViewportOrg.y )
{
saveflXform = dc->pdcattr->flXform & (PAGE_XLATE_CHANGED|WORLD_XFORM_CHANGED|DEVICE_TO_WORLD_INVALID);
ptlViewportOrg = dc->pdcattr->ptlViewportOrg;
dc->pdcattr->ptlViewportOrg = pgO->ptlViewportOrg;
flXform = (PAGE_XLATE_CHANGED|WORLD_XFORM_CHANGED|DEVICE_TO_WORLD_INVALID);
}
dc->pdcattr->ulDirty_ |= flags; dc->pdcattr->ulDirty_ |= flags;
jBkMode = dc->pdcattr->jBkMode; jBkMode = dc->pdcattr->jBkMode;
@ -312,6 +322,12 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
dc->pdcattr->jBkMode = jBkMode; dc->pdcattr->jBkMode = jBkMode;
dc->pdcattr->lBkMode = lBkMode; dc->pdcattr->lBkMode = lBkMode;
if (saveflXform)
{
dc->pdcattr->ptlViewportOrg = ptlViewportOrg;
dc->pdcattr->flXform |= saveflXform|flXform;
}
if (flags & DIRTY_TEXT && crColor != -1) if (flags & DIRTY_TEXT && crColor != -1)
{ {
dc->pdcattr->crForegroundClr = crColor; dc->pdcattr->crForegroundClr = crColor;
@ -341,7 +357,8 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
PGDIBSEXTTEXTOUT pgO; PGDIBSEXTTEXTOUT pgO;
COLORREF crBkColor; COLORREF crBkColor;
ULONG ulBackgroundClr; ULONG ulBackgroundClr;
DWORD flags = 0, saveflags; POINTL ptlViewportOrg;
DWORD flags = 0, flXform = 0, saveflags, saveflXform = 0;
if (!dc) break; if (!dc) break;
pgO = (PGDIBSEXTTEXTOUT) pHdr; pgO = (PGDIBSEXTTEXTOUT) pHdr;
@ -356,6 +373,15 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
flags |= (DIRTY_BACKGROUND|DIRTY_LINE|DIRTY_FILL); flags |= (DIRTY_BACKGROUND|DIRTY_LINE|DIRTY_FILL);
} }
if ( dc->pdcattr->ptlViewportOrg.x != pgO->ptlViewportOrg.x ||
dc->pdcattr->ptlViewportOrg.y != pgO->ptlViewportOrg.y )
{
saveflXform = dc->pdcattr->flXform & (PAGE_XLATE_CHANGED|WORLD_XFORM_CHANGED|DEVICE_TO_WORLD_INVALID);
ptlViewportOrg = dc->pdcattr->ptlViewportOrg;
dc->pdcattr->ptlViewportOrg = pgO->ptlViewportOrg;
flXform = (PAGE_XLATE_CHANGED|WORLD_XFORM_CHANGED|DEVICE_TO_WORLD_INVALID);
}
dc->pdcattr->ulDirty_ |= flags; dc->pdcattr->ulDirty_ |= flags;
IntExtTextOutW( dc, IntExtTextOutW( dc,
@ -368,6 +394,12 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
NULL, NULL,
0 ); 0 );
if (saveflXform)
{
dc->pdcattr->ptlViewportOrg = ptlViewportOrg;
dc->pdcattr->flXform |= saveflXform|flXform;
}
if (flags & DIRTY_BACKGROUND) if (flags & DIRTY_BACKGROUND)
{ {
dc->pdcattr->crBackgroundClr = crBkColor; dc->pdcattr->crBackgroundClr = crBkColor;