Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
ddc9860a
Commit
ddc9860a
authored
13 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
gdi32: Return a new path from PATH_WidenPath instead of replacing the DC path.
parent
f388827c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/gdi32/path.c
+15
-16
15 additions, 16 deletions
dlls/gdi32/path.c
with
15 additions
and
16 deletions
dlls/gdi32/path.c
+
15
−
16
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
=
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment