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
ddc9860a
Commit
ddc9860a
authored
Nov 22, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Return a new path from PATH_WidenPath instead of replacing the DC path.
parent
f388827c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
path.c
dlls/gdi32/path.c
+15
-16
No files found.
dlls/gdi32/path.c
View file @
ddc9860a
...
...
@@ -1755,19 +1755,17 @@ static BOOL PATH_StrokePath( HDC hdc, GdiPath *pPath )
#define round(x) ((int)((x)>0?(x)+0.5:(x)-0.5))
static
BOOL
PATH_WidenPath
(
DC
*
dc
)
static
struct
gdi_path
*
PATH_WidenPath
(
DC
*
dc
)
{
INT
i
,
j
,
numStrokes
,
penWidth
,
penWidthIn
,
penWidthOut
,
size
,
penStyle
;
BOOL
ret
=
FALSE
;
struct
gdi_path
*
flat_path
;
GdiPath
*
pNewPath
,
**
pStrokes
=
NULL
,
*
pUpPath
,
*
pDownPath
;
struct
gdi_path
*
flat_path
,
*
pNewPath
,
**
pStrokes
=
NULL
,
*
pUpPath
,
*
pDownPath
;
EXTLOGPEN
*
elp
;
DWORD
obj_type
,
joint
,
endcap
,
penType
;
size
=
GetObjectW
(
dc
->
hPen
,
0
,
NULL
);
if
(
!
size
)
{
SetLastError
(
ERROR_CAN_NOT_COMPLETE
);
return
FALSE
;
return
NULL
;
}
elp
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
...
...
@@ -1783,7 +1781,7 @@ static BOOL PATH_WidenPath(DC *dc)
else
{
SetLastError
(
ERROR_CAN_NOT_COMPLETE
);
HeapFree
(
GetProcessHeap
(),
0
,
elp
);
return
FALSE
;
return
NULL
;
}
penWidth
=
elp
->
elpWidth
;
...
...
@@ -1796,10 +1794,10 @@ static BOOL PATH_WidenPath(DC *dc)
/* The function cannot apply to cosmetic pens */
if
(
obj_type
==
OBJ_EXTPEN
&&
penType
==
PS_COSMETIC
)
{
SetLastError
(
ERROR_CAN_NOT_COMPLETE
);
return
FALSE
;
return
NULL
;
}
if
(
!
(
flat_path
=
PATH_FlattenPath
(
&
dc
->
path
)))
return
FALSE
;
if
(
!
(
flat_path
=
PATH_FlattenPath
(
&
dc
->
path
)))
return
NULL
;
penWidthIn
=
penWidth
/
2
;
penWidthOut
=
penWidth
/
2
;
...
...
@@ -1816,7 +1814,7 @@ static BOOL PATH_WidenPath(DC *dc)
i
==
0
?
"as first point"
:
"after PT_CLOSEFIGURE"
,
flat_path
->
pFlags
[
i
]);
free_gdi_path
(
flat_path
);
return
FALSE
;
return
NULL
;
}
switch
(
flat_path
->
pFlags
[
i
])
{
case
PT_MOVETO
:
...
...
@@ -1829,7 +1827,7 @@ static BOOL PATH_WidenPath(DC *dc)
pStrokes
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
GdiPath
*
));
else
pStrokes
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
pStrokes
,
numStrokes
*
sizeof
(
GdiPath
*
));
if
(
!
pStrokes
)
return
FALSE
;
if
(
!
pStrokes
)
return
NULL
;
pStrokes
[
numStrokes
-
1
]
=
alloc_gdi_path
();
/* fall through */
case
PT_LINETO
:
...
...
@@ -1844,7 +1842,7 @@ static BOOL PATH_WidenPath(DC *dc)
break
;
default:
ERR
(
"Got path flag %c
\n
"
,
flat_path
->
pFlags
[
i
]);
return
FALSE
;
return
NULL
;
}
}
...
...
@@ -2044,10 +2042,7 @@ static BOOL PATH_WidenPath(DC *dc)
free_gdi_path
(
flat_path
);
pNewPath
->
state
=
PATH_Closed
;
if
(
!
(
ret
=
PATH_AssignGdiPath
(
&
dc
->
path
,
pNewPath
)))
ERR
(
"Assign path failed
\n
"
);
free_gdi_path
(
pNewPath
);
return
ret
;
return
pNewPath
;
}
...
...
@@ -2228,13 +2223,17 @@ BOOL nulldrv_FlattenPath( PHYSDEV dev )
BOOL
nulldrv_WidenPath
(
PHYSDEV
dev
)
{
DC
*
dc
=
get_nulldrv_dc
(
dev
);
struct
gdi_path
*
path
;
if
(
dc
->
path
.
state
!=
PATH_Closed
)
{
SetLastError
(
ERROR_CAN_NOT_COMPLETE
);
return
FALSE
;
}
return
PATH_WidenPath
(
dc
);
if
(
!
(
path
=
PATH_WidenPath
(
dc
)))
return
FALSE
;
PATH_AssignGdiPath
(
&
dc
->
path
,
path
);
free_gdi_path
(
path
);
return
TRUE
;
}
const
struct
gdi_dc_funcs
path_driver
=
...
...
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