mirror of
https://github.com/reactos/reactos.git
synced 2024-09-06 02:37:06 +00:00
NtGdiExtTextOut (ExtTextOut in user-mode) should now obey at least the right clipping edge with ETO_CLIPPED.
svn path=/trunk/; revision=13275
This commit is contained in:
parent
83b24c1c23
commit
afec493812
|
@ -1493,7 +1493,7 @@ NtGdiExtTextOut(
|
||||||
LONGLONG TextLeft, RealXStart;
|
LONGLONG TextLeft, RealXStart;
|
||||||
ULONG TextTop, pitch, previous, BackgroundLeft;
|
ULONG TextTop, pitch, previous, BackgroundLeft;
|
||||||
FT_Bool use_kerning;
|
FT_Bool use_kerning;
|
||||||
RECTL DestRect, MaskRect;
|
RECTL DestRect, MaskRect, SpecifiedDestRect;
|
||||||
POINTL SourcePoint, BrushOrigin;
|
POINTL SourcePoint, BrushOrigin;
|
||||||
HBRUSH hBrushFg = NULL;
|
HBRUSH hBrushFg = NULL;
|
||||||
PGDIBRUSHOBJ BrushFg = NULL;
|
PGDIBRUSHOBJ BrushFg = NULL;
|
||||||
|
@ -1517,6 +1517,20 @@ NtGdiExtTextOut(
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
INT *Dx = NULL;
|
INT *Dx = NULL;
|
||||||
POINT Start;
|
POINT Start;
|
||||||
|
BOOL DoBreak = FALSE;
|
||||||
|
|
||||||
|
// TODO: Write test-cases to exactly match real Windows in different
|
||||||
|
// bad parameters (e.g. does Windows check the DC or the RECT first?).
|
||||||
|
if (lprc && (fuOptions & (ETO_OPAQUE | ETO_CLIPPED)))
|
||||||
|
{
|
||||||
|
// At least one of the two flags were specified. Copy lprc. Once.
|
||||||
|
Status = MmCopyFromCaller(&SpecifiedDestRect, lprc, sizeof(RECT));
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dc = DC_LockDc(hDC);
|
dc = DC_LockDc(hDC);
|
||||||
if (!dc)
|
if (!dc)
|
||||||
|
@ -1607,11 +1621,10 @@ NtGdiExtTextOut(
|
||||||
|
|
||||||
if ((fuOptions & ETO_OPAQUE) && lprc)
|
if ((fuOptions & ETO_OPAQUE) && lprc)
|
||||||
{
|
{
|
||||||
MmCopyFromCaller(&DestRect, lprc, sizeof(RECT));
|
DestRect.left = SpecifiedDestRect.left + dc->w.DCOrgX;
|
||||||
DestRect.left += dc->w.DCOrgX;
|
DestRect.top = SpecifiedDestRect.top + dc->w.DCOrgY;
|
||||||
DestRect.top += dc->w.DCOrgY;
|
DestRect.right = SpecifiedDestRect.right + dc->w.DCOrgX;
|
||||||
DestRect.right += dc->w.DCOrgX;
|
DestRect.bottom = SpecifiedDestRect.bottom + dc->w.DCOrgY;
|
||||||
DestRect.bottom += dc->w.DCOrgY;
|
|
||||||
IntEngBitBlt(
|
IntEngBitBlt(
|
||||||
BitmapObj,
|
BitmapObj,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -1880,6 +1893,17 @@ NtGdiExtTextOut(
|
||||||
* brush.
|
* brush.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (lprc &&
|
||||||
|
(fuOptions & ETO_CLIPPED) &&
|
||||||
|
DestRect.right >= SpecifiedDestRect.right + dc->w.DCOrgX)
|
||||||
|
{
|
||||||
|
// We do the check '>=' instead of '>' to possibly save an iteration
|
||||||
|
// through this loop, since it's breaking after the drawing is done,
|
||||||
|
// and x is always incremented.
|
||||||
|
DestRect.right = SpecifiedDestRect.right + dc->w.DCOrgX;
|
||||||
|
DoBreak = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
IntEngMaskBlt(
|
IntEngMaskBlt(
|
||||||
SurfObj,
|
SurfObj,
|
||||||
SourceGlyphSurf,
|
SourceGlyphSurf,
|
||||||
|
@ -1895,6 +1919,11 @@ NtGdiExtTextOut(
|
||||||
EngUnlockSurface(SourceGlyphSurf);
|
EngUnlockSurface(SourceGlyphSurf);
|
||||||
EngDeleteSurface((HSURF)HSourceGlyph);
|
EngDeleteSurface((HSURF)HSourceGlyph);
|
||||||
|
|
||||||
|
if (DoBreak)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (NULL == Dx)
|
if (NULL == Dx)
|
||||||
{
|
{
|
||||||
TextLeft += glyph->advance.x;
|
TextLeft += glyph->advance.x;
|
||||||
|
|
Loading…
Reference in a new issue