gdi32: Implement the ExtTextOut entry point in the path driver.
This commit is contained in:
parent
613972efe5
commit
c441d57452
|
@ -1822,7 +1822,7 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
|
||||||
if(rc.top > rc.bottom) {INT tmp = rc.top; rc.top = rc.bottom; rc.bottom = tmp;}
|
if(rc.top > rc.bottom) {INT tmp = rc.top; rc.top = rc.bottom; rc.bottom = tmp;}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flags & ETO_OPAQUE) && !PATH_IsPathOpen(dc->path))
|
if (flags & ETO_OPAQUE)
|
||||||
physdev->funcs->pExtTextOut( physdev, 0, 0, ETO_OPAQUE, &rc, NULL, 0, NULL );
|
physdev->funcs->pExtTextOut( physdev, 0, 0, ETO_OPAQUE, &rc, NULL, 0, NULL );
|
||||||
|
|
||||||
if(count == 0)
|
if(count == 0)
|
||||||
|
@ -1963,7 +1963,7 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetBkMode(hdc) != TRANSPARENT && !PATH_IsPathOpen(dc->path))
|
if (GetBkMode(hdc) != TRANSPARENT)
|
||||||
{
|
{
|
||||||
if(!((flags & ETO_CLIPPED) && (flags & ETO_OPAQUE)))
|
if(!((flags & ETO_CLIPPED) && (flags & ETO_OPAQUE)))
|
||||||
{
|
{
|
||||||
|
@ -2030,11 +2030,6 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
|
||||||
}
|
}
|
||||||
if(span)
|
if(span)
|
||||||
{
|
{
|
||||||
if (PATH_IsPathOpen(dc->path))
|
|
||||||
ret = PATH_ExtTextOut(dc, x + offsets[i - span].x, y + offsets[i - span].y,
|
|
||||||
(flags & ~ETO_OPAQUE) | ETO_GLYPH_INDEX, &rc,
|
|
||||||
glyphs, span, deltas ? (INT*)(deltas + (i - span)) : NULL);
|
|
||||||
else
|
|
||||||
physdev->funcs->pExtTextOut( physdev, x + offsets[i - span].x,
|
physdev->funcs->pExtTextOut( physdev, x + offsets[i - span].x,
|
||||||
y + offsets[i - span].y,
|
y + offsets[i - span].y,
|
||||||
(flags & ~ETO_OPAQUE) | ETO_GLYPH_INDEX, &rc, glyphs,
|
(flags & ~ETO_OPAQUE) | ETO_GLYPH_INDEX, &rc, glyphs,
|
||||||
|
@ -2047,12 +2042,6 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
|
||||||
|
|
||||||
if(i == count - 1)
|
if(i == count - 1)
|
||||||
{
|
{
|
||||||
if (PATH_IsPathOpen(dc->path))
|
|
||||||
ret = PATH_ExtTextOut(dc, x + (offsets ? offsets[count - span].x : 0),
|
|
||||||
y + (offsets ? offsets[count - span].y : 0),
|
|
||||||
(flags & ~ETO_OPAQUE) | ETO_GLYPH_INDEX, &rc,
|
|
||||||
glyphs, span, deltas ? (INT*)(deltas + (count - span)) : NULL);
|
|
||||||
else
|
|
||||||
ret = physdev->funcs->pExtTextOut(physdev, x + (offsets ? offsets[count - span].x : 0),
|
ret = physdev->funcs->pExtTextOut(physdev, x + (offsets ? offsets[count - span].x : 0),
|
||||||
y + (offsets ? offsets[count - span].y : 0),
|
y + (offsets ? offsets[count - span].y : 0),
|
||||||
(flags & ~ETO_OPAQUE) | ETO_GLYPH_INDEX, &rc, glyphs,
|
(flags & ~ETO_OPAQUE) | ETO_GLYPH_INDEX, &rc, glyphs,
|
||||||
|
@ -2070,11 +2059,6 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
|
||||||
GetGlyphIndicesW(hdc, reordered_str, count, glyphs, 0);
|
GetGlyphIndicesW(hdc, reordered_str, count, glyphs, 0);
|
||||||
flags |= ETO_GLYPH_INDEX;
|
flags |= ETO_GLYPH_INDEX;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PATH_IsPathOpen(dc->path))
|
|
||||||
ret = PATH_ExtTextOut(dc, x, y, (flags & ~ETO_OPAQUE), &rc,
|
|
||||||
glyphs ? glyphs : reordered_str, count, (INT*)deltas);
|
|
||||||
else
|
|
||||||
ret = physdev->funcs->pExtTextOut( physdev, x, y, (flags & ~ETO_OPAQUE), &rc,
|
ret = physdev->funcs->pExtTextOut( physdev, x, y, (flags & ~ETO_OPAQUE), &rc,
|
||||||
glyphs ? glyphs : reordered_str, count, (INT*)deltas );
|
glyphs ? glyphs : reordered_str, count, (INT*)deltas );
|
||||||
}
|
}
|
||||||
|
|
|
@ -314,20 +314,11 @@ extern METAHEADER *MF_CreateMetaHeaderDisk(METAHEADER *mr, LPCVOID filename, BOO
|
||||||
|
|
||||||
/* path.c */
|
/* path.c */
|
||||||
|
|
||||||
#define PATH_IsPathOpen(path) ((path).state==PATH_Open)
|
|
||||||
/* Returns TRUE if the specified path is in the open state, i.e. in the
|
|
||||||
* state where points will be added to the path, or FALSE otherwise. This
|
|
||||||
* function is implemented as a macro for performance reasons.
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern void PATH_InitGdiPath(GdiPath *pPath) DECLSPEC_HIDDEN;
|
extern void PATH_InitGdiPath(GdiPath *pPath) DECLSPEC_HIDDEN;
|
||||||
extern void PATH_DestroyGdiPath(GdiPath *pPath) DECLSPEC_HIDDEN;
|
extern void PATH_DestroyGdiPath(GdiPath *pPath) DECLSPEC_HIDDEN;
|
||||||
extern BOOL PATH_SavePath( DC *dst, DC *src ) DECLSPEC_HIDDEN;
|
extern BOOL PATH_SavePath( DC *dst, DC *src ) DECLSPEC_HIDDEN;
|
||||||
extern BOOL PATH_RestorePath( DC *dst, DC *src ) DECLSPEC_HIDDEN;
|
extern BOOL PATH_RestorePath( DC *dst, DC *src ) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
extern BOOL PATH_ExtTextOut(DC *dc, INT x, INT y, UINT flags, const RECT *lprc,
|
|
||||||
LPCWSTR str, UINT count, const INT *dx) DECLSPEC_HIDDEN;
|
|
||||||
|
|
||||||
/* painting.c */
|
/* painting.c */
|
||||||
extern POINT *GDI_Bezier( const POINT *Points, INT count, INT *nPtsOut ) DECLSPEC_HIDDEN;
|
extern POINT *GDI_Bezier( const POINT *Points, INT count, INT *nPtsOut ) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
|
|
|
@ -1470,9 +1470,9 @@ static void PATH_BezierTo(GdiPath *pPath, POINT *lppt, INT n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL PATH_add_outline(DC *dc, INT x, INT y, TTPOLYGONHEADER *header, DWORD size)
|
static BOOL PATH_add_outline(struct path_physdev *physdev, INT x, INT y,
|
||||||
|
TTPOLYGONHEADER *header, DWORD size)
|
||||||
{
|
{
|
||||||
GdiPath *pPath = &dc->path;
|
|
||||||
TTPOLYGONHEADER *start;
|
TTPOLYGONHEADER *start;
|
||||||
POINT pt;
|
POINT pt;
|
||||||
|
|
||||||
|
@ -1490,7 +1490,7 @@ static BOOL PATH_add_outline(DC *dc, INT x, INT y, TTPOLYGONHEADER *header, DWOR
|
||||||
|
|
||||||
pt.x = x + int_from_fixed(header->pfxStart.x);
|
pt.x = x + int_from_fixed(header->pfxStart.x);
|
||||||
pt.y = y - int_from_fixed(header->pfxStart.y);
|
pt.y = y - int_from_fixed(header->pfxStart.y);
|
||||||
PATH_AddEntry(pPath, &pt, PT_MOVETO);
|
PATH_AddEntry(physdev->path, &pt, PT_MOVETO);
|
||||||
|
|
||||||
curve = (TTPOLYCURVE *)(header + 1);
|
curve = (TTPOLYCURVE *)(header + 1);
|
||||||
|
|
||||||
|
@ -1508,7 +1508,7 @@ static BOOL PATH_add_outline(DC *dc, INT x, INT y, TTPOLYGONHEADER *header, DWOR
|
||||||
{
|
{
|
||||||
pt.x = x + int_from_fixed(curve->apfx[i].x);
|
pt.x = x + int_from_fixed(curve->apfx[i].x);
|
||||||
pt.y = y - int_from_fixed(curve->apfx[i].y);
|
pt.y = y - int_from_fixed(curve->apfx[i].y);
|
||||||
PATH_AddEntry(pPath, &pt, PT_LINETO);
|
PATH_AddEntry(physdev->path, &pt, PT_LINETO);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1533,7 +1533,7 @@ static BOOL PATH_add_outline(DC *dc, INT x, INT y, TTPOLYGONHEADER *header, DWOR
|
||||||
pts[i + 1].y = y - int_from_fixed(curve->apfx[i].y);
|
pts[i + 1].y = y - int_from_fixed(curve->apfx[i].y);
|
||||||
}
|
}
|
||||||
|
|
||||||
PATH_BezierTo(pPath, pts, curve->cpfx + 1);
|
PATH_BezierTo(physdev->path, pts, curve->cpfx + 1);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, pts);
|
HeapFree(GetProcessHeap(), 0, pts);
|
||||||
break;
|
break;
|
||||||
|
@ -1550,22 +1550,19 @@ static BOOL PATH_add_outline(DC *dc, INT x, INT y, TTPOLYGONHEADER *header, DWOR
|
||||||
header = (TTPOLYGONHEADER *)((char *)header + header->cb);
|
header = (TTPOLYGONHEADER *)((char *)header + header->cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
return CloseFigure(dc->hSelf);
|
return CloseFigure(physdev->dev.hdc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/*************************************************************
|
||||||
* PATH_ExtTextOut
|
* pathdrv_ExtTextOut
|
||||||
*/
|
*/
|
||||||
BOOL PATH_ExtTextOut(DC *dc, INT x, INT y, UINT flags, const RECT *lprc,
|
static BOOL pathdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *lprc,
|
||||||
LPCWSTR str, UINT count, const INT *dx)
|
LPCWSTR str, UINT count, const INT *dx )
|
||||||
{
|
{
|
||||||
|
struct path_physdev *physdev = get_path_physdev( dev );
|
||||||
unsigned int idx;
|
unsigned int idx;
|
||||||
HDC hdc = dc->hSelf;
|
|
||||||
POINT offset = {0, 0};
|
POINT offset = {0, 0};
|
||||||
|
|
||||||
TRACE("%p, %d, %d, %08x, %s, %s, %d, %p)\n", hdc, x, y, flags,
|
|
||||||
wine_dbgstr_rect(lprc), debugstr_wn(str, count), count, dx);
|
|
||||||
|
|
||||||
if (!count) return TRUE;
|
if (!count) return TRUE;
|
||||||
|
|
||||||
for (idx = 0; idx < count; idx++)
|
for (idx = 0; idx < count; idx++)
|
||||||
|
@ -1575,7 +1572,8 @@ BOOL PATH_ExtTextOut(DC *dc, INT x, INT y, UINT flags, const RECT *lprc,
|
||||||
DWORD dwSize;
|
DWORD dwSize;
|
||||||
void *outline;
|
void *outline;
|
||||||
|
|
||||||
dwSize = GetGlyphOutlineW(hdc, str[idx], GGO_GLYPH_INDEX | GGO_NATIVE, &gm, 0, NULL, &identity);
|
dwSize = GetGlyphOutlineW(dev->hdc, str[idx], GGO_GLYPH_INDEX | GGO_NATIVE,
|
||||||
|
&gm, 0, NULL, &identity);
|
||||||
if (dwSize == GDI_ERROR) return FALSE;
|
if (dwSize == GDI_ERROR) return FALSE;
|
||||||
|
|
||||||
/* add outline only if char is printable */
|
/* add outline only if char is printable */
|
||||||
|
@ -1584,9 +1582,10 @@ BOOL PATH_ExtTextOut(DC *dc, INT x, INT y, UINT flags, const RECT *lprc,
|
||||||
outline = HeapAlloc(GetProcessHeap(), 0, dwSize);
|
outline = HeapAlloc(GetProcessHeap(), 0, dwSize);
|
||||||
if (!outline) return FALSE;
|
if (!outline) return FALSE;
|
||||||
|
|
||||||
GetGlyphOutlineW(hdc, str[idx], GGO_GLYPH_INDEX | GGO_NATIVE, &gm, dwSize, outline, &identity);
|
GetGlyphOutlineW(dev->hdc, str[idx], GGO_GLYPH_INDEX | GGO_NATIVE,
|
||||||
|
&gm, dwSize, outline, &identity);
|
||||||
|
|
||||||
PATH_add_outline(dc, x + offset.x, y + offset.y, outline, dwSize);
|
PATH_add_outline(physdev, x + offset.x, y + offset.y, outline, dwSize);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, outline);
|
HeapFree(GetProcessHeap(), 0, outline);
|
||||||
}
|
}
|
||||||
|
@ -2300,7 +2299,7 @@ const struct gdi_dc_funcs path_driver =
|
||||||
NULL, /* pExtEscape */
|
NULL, /* pExtEscape */
|
||||||
NULL, /* pExtFloodFill */
|
NULL, /* pExtFloodFill */
|
||||||
NULL, /* pExtSelectClipRgn */
|
NULL, /* pExtSelectClipRgn */
|
||||||
NULL, /* pExtTextOut */
|
pathdrv_ExtTextOut, /* pExtTextOut */
|
||||||
NULL, /* pFillPath */
|
NULL, /* pFillPath */
|
||||||
NULL, /* pFillRgn */
|
NULL, /* pFillRgn */
|
||||||
NULL, /* pFlattenPath */
|
NULL, /* pFlattenPath */
|
||||||
|
|
Loading…
Reference in New Issue