Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d92ed5bd
Commit
d92ed5bd
authored
May 06, 2010
by
Huw Davies
Committed by
Alexandre Julliard
May 06, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add support for ETO_PDY and improve world transform support.
parent
4733bd81
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
72 deletions
+82
-72
font.c
dlls/gdi32/font.c
+0
-0
path.c
dlls/gdi32/path.c
+11
-21
text.c
dlls/wineps.drv/text.c
+10
-7
xrender.c
dlls/winex11.drv/xrender.c
+61
-44
No files found.
dlls/gdi32/font.c
View file @
d92ed5bd
This diff is collapsed.
Click to expand it.
dlls/gdi32/path.c
View file @
d92ed5bd
...
...
@@ -1423,28 +1423,14 @@ BOOL PATH_ExtTextOut(DC *dc, INT x, INT y, UINT flags, const RECT *lprc,
LPCWSTR
str
,
UINT
count
,
const
INT
*
dx
)
{
unsigned
int
idx
;
double
cosEsc
,
sinEsc
;
LOGFONTW
lf
;
HDC
hdc
=
dc
->
hSelf
;
INT
offset
=
0
,
xoff
=
0
,
yoff
=
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
;
GetObjectW
(
GetCurrentObject
(
hdc
,
OBJ_FONT
),
sizeof
(
lf
),
&
lf
);
if
(
lf
.
lfEscapement
!=
0
)
{
cosEsc
=
cos
(
lf
.
lfEscapement
*
M_PI
/
1800
);
sinEsc
=
sin
(
lf
.
lfEscapement
*
M_PI
/
1800
);
}
else
{
cosEsc
=
1
;
sinEsc
=
0
;
}
for
(
idx
=
0
;
idx
<
count
;
idx
++
)
{
static
const
MAT2
identity
=
{
{
0
,
1
},{
0
,
0
},{
0
,
0
},{
0
,
1
}
};
...
...
@@ -1463,21 +1449,25 @@ BOOL PATH_ExtTextOut(DC *dc, INT x, INT y, UINT flags, const RECT *lprc,
GetGlyphOutlineW
(
hdc
,
str
[
idx
],
GGO_GLYPH_INDEX
|
GGO_NATIVE
,
&
gm
,
dwSize
,
outline
,
&
identity
);
PATH_add_outline
(
dc
,
x
+
xoff
,
y
+
yoff
,
outline
,
dwSize
);
PATH_add_outline
(
dc
,
x
+
offset
.
x
,
y
+
offset
.
y
,
outline
,
dwSize
);
HeapFree
(
GetProcessHeap
(),
0
,
outline
);
}
if
(
dx
)
{
offset
+=
dx
[
idx
];
xoff
=
offset
*
cosEsc
;
yoff
=
offset
*
-
sinEsc
;
if
(
flags
&
ETO_PDY
)
{
offset
.
x
+=
dx
[
idx
*
2
];
offset
.
y
+=
dx
[
idx
*
2
+
1
];
}
else
offset
.
x
+=
dx
[
idx
];
}
else
{
xoff
+=
gm
.
gmCellIncX
;
yoff
+=
gm
.
gmCellIncY
;
offset
.
x
+=
gm
.
gmCellIncX
;
offset
.
y
+=
gm
.
gmCellIncY
;
}
}
return
TRUE
;
...
...
dlls/wineps.drv/text.c
View file @
d92ed5bd
...
...
@@ -112,18 +112,21 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR
}
else
{
UINT
i
;
float
dx
=
0
.
0
,
dy
=
0
.
0
;
float
cos_theta
=
cos
(
physDev
->
font
.
escapement
*
M_PI
/
1800
.
0
);
float
sin_theta
=
sin
(
physDev
->
font
.
escapement
*
M_PI
/
1800
.
0
);
POINT
offset
=
{
0
,
0
};
for
(
i
=
0
;
i
<
count
-
1
;
i
++
)
{
TRACE
(
"lpDx[%d] = %d
\n
"
,
i
,
lpDx
[
i
]);
if
(
physDev
->
font
.
fontloc
==
Download
)
PSDRV_WriteDownloadGlyphShow
(
physDev
,
glyphs
+
i
,
1
);
else
PSDRV_WriteBuiltinGlyphShow
(
physDev
,
str
+
i
,
1
);
dx
+=
lpDx
[
i
]
*
cos_theta
;
dy
-=
lpDx
[
i
]
*
sin_theta
;
PSDRV_WriteMoveTo
(
physDev
,
x
+
dx
,
y
+
dy
);
if
(
flags
&
ETO_PDY
)
{
offset
.
x
+=
lpDx
[
i
*
2
];
offset
.
y
+=
lpDx
[
i
*
2
+
1
];
}
else
offset
.
x
+=
lpDx
[
i
];
PSDRV_WriteMoveTo
(
physDev
,
x
+
offset
.
x
,
y
+
offset
.
y
);
}
if
(
physDev
->
font
.
fontloc
==
Download
)
PSDRV_WriteDownloadGlyphShow
(
physDev
,
glyphs
+
i
,
1
);
...
...
dlls/winex11.drv/xrender.c
View file @
d92ed5bd
...
...
@@ -1626,8 +1626,6 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
AA_Type
aa_type
=
AA_None
;
DIBSECTION
bmp
;
unsigned
int
idx
;
double
cosEsc
,
sinEsc
;
LOGFONTW
lf
;
const
WineXRenderFormat
*
dst_format
=
get_xrender_format_from_color_shifts
(
physDev
->
depth
,
physDev
->
color_shifts
);
Picture
tile_pict
=
0
;
...
...
@@ -1678,16 +1676,6 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
goto
done_unlock
;
}
GetObjectW
(
GetCurrentObject
(
physDev
->
hdc
,
OBJ_FONT
),
sizeof
(
lf
),
&
lf
);
if
(
lf
.
lfEscapement
!=
0
)
{
cosEsc
=
cos
(
lf
.
lfEscapement
*
M_PI
/
1800
);
sinEsc
=
sin
(
lf
.
lfEscapement
*
M_PI
/
1800
);
}
else
{
cosEsc
=
1
;
sinEsc
=
0
;
}
if
(
flags
&
ETO_CLIPPED
)
{
HRGN
clip_region
;
...
...
@@ -1731,7 +1719,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
if
(
X11DRV_XRender_Installed
)
{
XGlyphElt16
*
elts
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
XGlyphElt16
)
*
count
);
INT
offset
=
0
;
POINT
offset
=
{
0
,
0
}
;
POINT
desired
,
current
;
int
render_op
=
PictOpOver
;
Picture
pict
=
get_xrender_picture
(
physDev
);
...
...
@@ -1769,9 +1757,15 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
}
else
{
offset
+=
lpDx
[
idx
];
desired
.
x
=
physDev
->
dc_rect
.
left
+
x
+
offset
*
cosEsc
;
desired
.
y
=
physDev
->
dc_rect
.
top
+
y
-
offset
*
sinEsc
;
if
(
flags
&
ETO_PDY
)
{
offset
.
x
+=
lpDx
[
idx
*
2
];
offset
.
y
+=
lpDx
[
idx
*
2
+
1
];
}
else
offset
.
x
+=
lpDx
[
idx
];
desired
.
x
=
physDev
->
dc_rect
.
left
+
x
+
offset
.
x
;
desired
.
y
=
physDev
->
dc_rect
.
top
+
y
+
offset
.
y
;
}
}
wine_tsx11_lock
();
...
...
@@ -1785,7 +1779,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
wine_tsx11_unlock
();
HeapFree
(
GetProcessHeap
(),
0
,
elts
);
}
else
{
INT
offset
=
0
,
xoff
=
0
,
yoff
=
0
;
POINT
offset
=
{
0
,
0
}
;
wine_tsx11_lock
();
XSetForeground
(
gdi_display
,
physDev
->
gc
,
textPixel
);
...
...
@@ -1799,17 +1793,25 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
sharp_glyph_fn
=
SharpGlyphGray
;
for
(
idx
=
0
;
idx
<
count
;
idx
++
)
{
sharp_glyph_fn
(
physDev
,
physDev
->
dc_rect
.
left
+
x
+
xoff
,
physDev
->
dc_rect
.
top
+
y
+
yoff
,
sharp_glyph_fn
(
physDev
,
physDev
->
dc_rect
.
left
+
x
+
offset
.
x
,
physDev
->
dc_rect
.
top
+
y
+
offset
.
y
,
formatEntry
->
bitmaps
[
wstr
[
idx
]],
&
formatEntry
->
gis
[
wstr
[
idx
]]);
if
(
lpDx
)
{
offset
+=
lpDx
[
idx
];
xoff
=
offset
*
cosEsc
;
yoff
=
offset
*
-
sinEsc
;
}
else
{
xoff
+=
formatEntry
->
gis
[
wstr
[
idx
]].
xOff
;
yoff
+=
formatEntry
->
gis
[
wstr
[
idx
]].
yOff
;
if
(
lpDx
)
{
if
(
flags
&
ETO_PDY
)
{
offset
.
x
+=
lpDx
[
idx
*
2
];
offset
.
y
+=
lpDx
[
idx
*
2
+
1
];
}
else
offset
.
x
+=
lpDx
[
idx
];
}
else
{
offset
.
x
+=
formatEntry
->
gis
[
wstr
[
idx
]].
xOff
;
offset
.
y
+=
formatEntry
->
gis
[
wstr
[
idx
]].
yOff
;
}
}
}
else
{
...
...
@@ -1831,13 +1833,21 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
extents
.
right
=
cur
.
x
-
formatEntry
->
gis
[
wstr
[
idx
]].
x
+
formatEntry
->
gis
[
wstr
[
idx
]].
width
;
if
(
extents
.
bottom
<
cur
.
y
-
formatEntry
->
gis
[
wstr
[
idx
]].
y
+
formatEntry
->
gis
[
wstr
[
idx
]].
height
)
extents
.
bottom
=
cur
.
y
-
formatEntry
->
gis
[
wstr
[
idx
]].
y
+
formatEntry
->
gis
[
wstr
[
idx
]].
height
;
if
(
lpDx
)
{
offset
+=
lpDx
[
idx
];
cur
.
x
=
offset
*
cosEsc
;
cur
.
y
=
offset
*
-
sinEsc
;
}
else
{
cur
.
x
+=
formatEntry
->
gis
[
wstr
[
idx
]].
xOff
;
cur
.
y
+=
formatEntry
->
gis
[
wstr
[
idx
]].
yOff
;
if
(
lpDx
)
{
if
(
flags
&
ETO_PDY
)
{
cur
.
x
+=
lpDx
[
idx
*
2
];
cur
.
y
+=
lpDx
[
idx
*
2
+
1
];
}
else
cur
.
x
+=
lpDx
[
idx
];
}
else
{
cur
.
x
+=
formatEntry
->
gis
[
wstr
[
idx
]].
xOff
;
cur
.
y
+=
formatEntry
->
gis
[
wstr
[
idx
]].
yOff
;
}
}
TRACE
(
"glyph extents %d,%d - %d,%d drawable x,y %d,%d
\n
"
,
extents
.
left
,
extents
.
top
,
...
...
@@ -1901,21 +1911,28 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
image
->
green_mask
=
visual
->
green_mask
;
image
->
blue_mask
=
visual
->
blue_mask
;
offset
=
xoff
=
yoff
=
0
;
for
(
idx
=
0
;
idx
<
count
;
idx
++
)
{
SmoothGlyphGray
(
image
,
xoff
+
image_off_x
-
extents
.
left
,
yoff
+
image_off_y
-
extents
.
top
,
SmoothGlyphGray
(
image
,
offset
.
x
+
image_off_x
-
extents
.
left
,
offset
.
y
+
image_off_y
-
extents
.
top
,
formatEntry
->
bitmaps
[
wstr
[
idx
]],
&
formatEntry
->
gis
[
wstr
[
idx
]],
physDev
->
textPixel
);
if
(
lpDx
)
{
offset
+=
lpDx
[
idx
];
xoff
=
offset
*
cosEsc
;
yoff
=
offset
*
-
sinEsc
;
}
else
{
xoff
+=
formatEntry
->
gis
[
wstr
[
idx
]].
xOff
;
yoff
+=
formatEntry
->
gis
[
wstr
[
idx
]].
yOff
;
}
if
(
lpDx
)
{
if
(
flags
&
ETO_PDY
)
{
offset
.
x
+=
lpDx
[
idx
*
2
];
offset
.
y
+=
lpDx
[
idx
*
2
+
1
];
}
else
offset
.
x
+=
lpDx
[
idx
];
}
else
{
offset
.
x
+=
formatEntry
->
gis
[
wstr
[
idx
]].
xOff
;
offset
.
y
+=
formatEntry
->
gis
[
wstr
[
idx
]].
yOff
;
}
}
XPutImage
(
gdi_display
,
physDev
->
drawable
,
physDev
->
gc
,
image
,
0
,
0
,
image_x
,
image_y
,
image_w
,
image_h
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment