https://git.reactos.org/?p=reactos.git;a=commitdiff;h=04a04659dae9b61712b75…
commit 04a04659dae9b61712b75dfaf94df20ae5a10242
Author: jimtabor <james.tabor(a)reactos.org>
AuthorDate: Thu May 2 10:11:11 2019 -0500
Commit: jimtabor <james.tabor(a)reactos.org>
CommitDate: Thu May 2 10:11:11 2019 -0500
[NtGDI] Adding Support for Viewport TextOut
Add Viewport changes to Text Out Batch.
---
win32ss/gdi/ntgdi/gdibatch.c | 36 ++++++++++++++++++++++++++++++++++--
1 file changed, 34 insertions(+), 2 deletions(-)
diff --git a/win32ss/gdi/ntgdi/gdibatch.c b/win32ss/gdi/ntgdi/gdibatch.c
index 13d6ad9088..d292e2e831 100644
--- a/win32ss/gdi/ntgdi/gdibatch.c
+++ b/win32ss/gdi/ntgdi/gdibatch.c
@@ -246,12 +246,13 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
PGDIBSTEXTOUT pgO;
COLORREF crColor = -1, crBkColor;
ULONG ulForegroundClr, ulBackgroundClr;
- DWORD flags = 0, saveflags;
+ DWORD flags = 0, flXform = 0, saveflags, saveflXform = 0;
FLONG flTextAlign = -1;
HANDLE hlfntNew;
PRECTL lprc;
USHORT jBkMode;
LONG lBkMode;
+ POINTL ptlViewportOrg;
if (!dc) break;
pgO = (PGDIBSTEXTOUT) pHdr;
@@ -288,6 +289,15 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
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;
jBkMode = dc->pdcattr->jBkMode;
@@ -312,6 +322,12 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
dc->pdcattr->jBkMode = jBkMode;
dc->pdcattr->lBkMode = lBkMode;
+ if (saveflXform)
+ {
+ dc->pdcattr->ptlViewportOrg = ptlViewportOrg;
+ dc->pdcattr->flXform |= saveflXform|flXform;
+ }
+
if (flags & DIRTY_TEXT && crColor != -1)
{
dc->pdcattr->crForegroundClr = crColor;
@@ -341,7 +357,8 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
PGDIBSEXTTEXTOUT pgO;
COLORREF crBkColor;
ULONG ulBackgroundClr;
- DWORD flags = 0, saveflags;
+ POINTL ptlViewportOrg;
+ DWORD flags = 0, flXform = 0, saveflags, saveflXform = 0;
if (!dc) break;
pgO = (PGDIBSEXTTEXTOUT) pHdr;
@@ -356,6 +373,15 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
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;
IntExtTextOutW( dc,
@@ -368,6 +394,12 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
NULL,
0 );
+ if (saveflXform)
+ {
+ dc->pdcattr->ptlViewportOrg = ptlViewportOrg;
+ dc->pdcattr->flXform |= saveflXform|flXform;
+ }
+
if (flags & DIRTY_BACKGROUND)
{
dc->pdcattr->crBackgroundClr = crBkColor;