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
e1271011
Commit
e1271011
authored
Aug 31, 2017
by
Vincent Povirk
Committed by
Alexandre Julliard
Sep 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Send paths to gdi32 in device coordinates.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
93e8507a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
13 deletions
+50
-13
graphics.c
dlls/gdiplus/graphics.c
+46
-13
region.c
dlls/gdiplus/region.c
+4
-0
No files found.
dlls/gdiplus/graphics.c
View file @
e1271011
...
...
@@ -249,6 +249,14 @@ static INT prepare_dc(GpGraphics *graphics, GpPen *pen)
width
*=
units_to_pixels
(
pen
->
width
,
pen
->
unit
==
UnitWorld
?
graphics
->
unit
:
pen
->
unit
,
graphics
->
xres
);
width
*=
graphics
->
scale
;
pt
[
0
].
X
=
0
.
0
;
pt
[
0
].
Y
=
0
.
0
;
pt
[
1
].
X
=
1
.
0
;
pt
[
1
].
Y
=
1
.
0
;
gdip_transform_points
(
graphics
,
WineCoordinateSpaceGdiDevice
,
CoordinateSpaceDevice
,
pt
,
2
);
width
*=
sqrt
((
pt
[
1
].
X
-
pt
[
0
].
X
)
*
(
pt
[
1
].
X
-
pt
[
0
].
X
)
+
(
pt
[
1
].
Y
-
pt
[
0
].
Y
)
*
(
pt
[
1
].
Y
-
pt
[
0
].
Y
))
/
sqrt
(
2
.
0
);
}
if
(
pen
->
dash
==
DashStyleCustom
){
...
...
@@ -1573,7 +1581,10 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s
ptf
[
3
].
X
=
x2
-
dbig
;
ptf
[
2
].
X
=
x2
+
dsmall
;
transform_and_round_points
(
graphics
,
pt
,
ptf
,
4
);
gdip_transform_points
(
graphics
,
WineCoordinateSpaceGdiDevice
,
CoordinateSpaceWorld
,
ptf
,
3
);
round_points
(
pt
,
ptf
,
3
);
Polygon
(
graphics
->
hdc
,
pt
,
4
);
break
;
...
...
@@ -1595,7 +1606,10 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s
ptf
[
2
].
X
=
x2
;
ptf
[
2
].
Y
=
y2
;
transform_and_round_points
(
graphics
,
pt
,
ptf
,
3
);
gdip_transform_points
(
graphics
,
WineCoordinateSpaceGdiDevice
,
CoordinateSpaceWorld
,
ptf
,
3
);
round_points
(
pt
,
ptf
,
3
);
Polygon
(
graphics
->
hdc
,
pt
,
3
);
break
;
...
...
@@ -1607,7 +1621,10 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s
ptf
[
1
].
X
=
x2
+
dx
;
ptf
[
1
].
Y
=
y2
+
dy
;
transform_and_round_points
(
graphics
,
pt
,
ptf
,
2
);
gdip_transform_points
(
graphics
,
WineCoordinateSpaceGdiDevice
,
CoordinateSpaceWorld
,
ptf
,
3
);
round_points
(
pt
,
ptf
,
3
);
Ellipse
(
graphics
->
hdc
,
pt
[
0
].
x
,
pt
[
0
].
y
,
pt
[
1
].
x
,
pt
[
1
].
y
);
break
;
...
...
@@ -1627,7 +1644,10 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s
ptf
[
2
].
X
=
x2
+
dx
;
ptf
[
2
].
Y
=
y2
+
dy
;
transform_and_round_points
(
graphics
,
pt
,
ptf
,
3
);
gdip_transform_points
(
graphics
,
WineCoordinateSpaceGdiDevice
,
CoordinateSpaceWorld
,
ptf
,
3
);
round_points
(
pt
,
ptf
,
3
);
Polygon
(
graphics
->
hdc
,
pt
,
3
);
break
;
...
...
@@ -1647,7 +1667,10 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s
ptf
[
3
].
X
=
x2
+
dx
;
ptf
[
3
].
Y
=
y2
+
dy
;
transform_and_round_points
(
graphics
,
pt
,
ptf
,
4
);
gdip_transform_points
(
graphics
,
WineCoordinateSpaceGdiDevice
,
CoordinateSpaceWorld
,
ptf
,
3
);
round_points
(
pt
,
ptf
,
3
);
Pie
(
graphics
->
hdc
,
pt
[
0
].
x
,
pt
[
0
].
y
,
pt
[
1
].
x
,
pt
[
1
].
y
,
pt
[
2
].
x
,
pt
[
2
].
y
,
pt
[
3
].
x
,
pt
[
3
].
y
);
...
...
@@ -1673,7 +1696,9 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s
GdipTranslateMatrix
(
&
matrix
,
x2
,
y2
,
MatrixOrderAppend
);
GdipTransformMatrixPoints
(
&
matrix
,
custptf
,
count
);
transform_and_round_points
(
graphics
,
custpt
,
custptf
,
count
);
gdip_transform_points
(
graphics
,
WineCoordinateSpaceGdiDevice
,
CoordinateSpaceWorld
,
ptf
,
3
);
round_points
(
pt
,
ptf
,
3
);
for
(
i
=
0
;
i
<
count
;
i
++
)
tp
[
i
]
=
convert_path_point_type
(
custom
->
pathdata
.
Types
[
i
]);
...
...
@@ -1896,7 +1921,9 @@ static GpStatus draw_poly(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *
}
}
transform_and_round_points
(
graphics
,
pti
,
ptcopy
,
count
);
gdip_transform_points
(
graphics
,
WineCoordinateSpaceGdiDevice
,
CoordinateSpaceWorld
,
ptcopy
,
count
);
round_points
(
pti
,
ptcopy
,
count
);
for
(
i
=
0
;
i
<
count
;
i
++
){
tp
[
i
]
=
convert_path_point_type
(
types
[
i
]);
...
...
@@ -3433,9 +3460,13 @@ static GpStatus GDI32_GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *pat
if
(
hrgn
)
ExtSelectClipRgn
(
graphics
->
hdc
,
hrgn
,
RGN_AND
);
gdi_transform_acquire
(
graphics
);
retval
=
draw_poly
(
graphics
,
pen
,
path
->
pathdata
.
Points
,
path
->
pathdata
.
Types
,
path
->
pathdata
.
Count
,
TRUE
);
gdi_transform_release
(
graphics
);
end
:
restore_dc
(
graphics
,
save_state
);
DeleteObject
(
hrgn
);
...
...
@@ -4114,17 +4145,19 @@ static GpStatus GDI32_GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath
if
(
hrgn
)
ExtSelectClipRgn
(
graphics
->
hdc
,
hrgn
,
RGN_AND
);
gdi_transform_acquire
(
graphics
);
BeginPath
(
graphics
->
hdc
);
retval
=
draw_poly
(
graphics
,
NULL
,
path
->
pathdata
.
Points
,
path
->
pathdata
.
Types
,
path
->
pathdata
.
Count
,
FALSE
);
if
(
retval
!
=
Ok
)
goto
end
;
EndPath
(
graphics
->
hdc
);
brush_fill_path
(
graphics
,
brush
);
if
(
retval
=
=
Ok
)
{
EndPath
(
graphics
->
hdc
);
brush_fill_path
(
graphics
,
brush
);
}
retval
=
Ok
;
gdi_transform_release
(
graphics
)
;
end
:
RestoreDC
(
graphics
->
hdc
,
save_state
);
...
...
dlls/gdiplus/region.c
View file @
e1271011
...
...
@@ -1059,6 +1059,8 @@ static GpStatus get_path_hrgn(GpPath *path, GpGraphics *graphics, HRGN *hrgn)
SetPolyFillMode
(
graphics
->
hdc
,
(
path
->
fill
==
FillModeAlternate
?
ALTERNATE
:
WINDING
));
gdi_transform_acquire
(
graphics
);
stat
=
trace_path
(
graphics
,
path
);
if
(
stat
==
Ok
)
{
...
...
@@ -1066,6 +1068,8 @@ static GpStatus get_path_hrgn(GpPath *path, GpGraphics *graphics, HRGN *hrgn)
stat
=
*
hrgn
?
Ok
:
OutOfMemory
;
}
gdi_transform_release
(
graphics
);
RestoreDC
(
graphics
->
hdc
,
save_state
);
if
(
new_hdc
)
{
...
...
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