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
54ec8602
Commit
54ec8602
authored
Jul 14, 2016
by
Huw Davies
Committed by
Alexandre Julliard
Jul 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Change get_gdi_flat_path() to return an opaque path pointer.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
23751e0a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
25 deletions
+23
-25
graphics.c
dlls/gdi32/dibdrv/graphics.c
+4
-5
graphics.c
dlls/gdi32/enhmfdrv/graphics.c
+5
-6
gdi_private.h
dlls/gdi32/gdi_private.h
+2
-1
path.c
dlls/gdi32/path.c
+12
-13
No files found.
dlls/gdi32/dibdrv/graphics.c
View file @
54ec8602
...
@@ -405,6 +405,7 @@ static BOOL draw_arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
...
@@ -405,6 +405,7 @@ static BOOL draw_arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
/* helper for path stroking and filling functions */
/* helper for path stroking and filling functions */
static
BOOL
stroke_and_fill_path
(
dibdrv_physdev
*
dev
,
BOOL
stroke
,
BOOL
fill
)
static
BOOL
stroke_and_fill_path
(
dibdrv_physdev
*
dev
,
BOOL
stroke
,
BOOL
fill
)
{
{
struct
gdi_path
*
path
;
POINT
*
points
;
POINT
*
points
;
BYTE
*
types
;
BYTE
*
types
;
BOOL
ret
=
TRUE
;
BOOL
ret
=
TRUE
;
...
@@ -413,9 +414,8 @@ static BOOL stroke_and_fill_path( dibdrv_physdev *dev, BOOL stroke, BOOL fill )
...
@@ -413,9 +414,8 @@ static BOOL stroke_and_fill_path( dibdrv_physdev *dev, BOOL stroke, BOOL fill )
if
(
dev
->
brush
.
style
==
BS_NULL
)
fill
=
FALSE
;
if
(
dev
->
brush
.
style
==
BS_NULL
)
fill
=
FALSE
;
total
=
get_gdi_flat_path
(
dev
->
dev
.
hdc
,
&
points
,
&
types
,
fill
?
&
interior
:
NULL
);
if
(
!
(
path
=
get_gdi_flat_path
(
dev
->
dev
.
hdc
,
fill
?
&
interior
:
NULL
)))
return
FALSE
;
if
(
total
==
-
1
)
return
FALSE
;
if
(
!
(
total
=
get_gdi_path_data
(
path
,
&
points
,
&
types
)))
goto
done
;
if
(
!
total
)
goto
done
;
if
(
stroke
&&
dev
->
pen_uses_region
)
outline
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
if
(
stroke
&&
dev
->
pen_uses_region
)
outline
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
...
@@ -464,8 +464,7 @@ static BOOL stroke_and_fill_path( dibdrv_physdev *dev, BOOL stroke, BOOL fill )
...
@@ -464,8 +464,7 @@ static BOOL stroke_and_fill_path( dibdrv_physdev *dev, BOOL stroke, BOOL fill )
}
}
done:
done:
HeapFree
(
GetProcessHeap
(),
0
,
points
);
free_gdi_path
(
path
);
HeapFree
(
GetProcessHeap
(),
0
,
types
);
return
ret
;
return
ret
;
}
}
...
...
dlls/gdi32/enhmfdrv/graphics.c
View file @
54ec8602
...
@@ -100,24 +100,23 @@ static void get_points_bounds( RECTL *bounds, const POINT *pts, UINT count, HDC
...
@@ -100,24 +100,23 @@ static void get_points_bounds( RECTL *bounds, const POINT *pts, UINT count, HDC
static
BOOL
emfdrv_stroke_and_fill_path
(
PHYSDEV
dev
,
INT
type
)
static
BOOL
emfdrv_stroke_and_fill_path
(
PHYSDEV
dev
,
INT
type
)
{
{
EMRSTROKEANDFILLPATH
emr
;
EMRSTROKEANDFILLPATH
emr
;
int
count
;
struct
gdi_path
*
path
;
POINT
*
points
;
POINT
*
points
;
BYTE
*
flags
;
BYTE
*
flags
;
emr
.
emr
.
iType
=
type
;
emr
.
emr
.
iType
=
type
;
emr
.
emr
.
nSize
=
sizeof
(
emr
);
emr
.
emr
.
nSize
=
sizeof
(
emr
);
count
=
get_gdi_flat_path
(
dev
->
hdc
,
&
points
,
&
flags
,
NULL
);
if
((
path
=
get_gdi_flat_path
(
dev
->
hdc
,
NULL
)))
if
(
count
>=
0
)
{
{
int
count
=
get_gdi_path_data
(
path
,
&
points
,
&
flags
);
get_points_bounds
(
&
emr
.
rclBounds
,
points
,
count
,
0
);
get_points_bounds
(
&
emr
.
rclBounds
,
points
,
count
,
0
);
HeapFree
(
GetProcessHeap
(),
0
,
points
);
free_gdi_path
(
path
);
HeapFree
(
GetProcessHeap
(),
0
,
flags
);
}
}
else
emr
.
rclBounds
=
empty_bounds
;
else
emr
.
rclBounds
=
empty_bounds
;
if
(
!
EMFDRV_WriteRecord
(
dev
,
&
emr
.
emr
))
return
FALSE
;
if
(
!
EMFDRV_WriteRecord
(
dev
,
&
emr
.
emr
))
return
FALSE
;
if
(
count
<
0
)
return
FALSE
;
if
(
!
path
)
return
FALSE
;
EMFDRV_UpdateBBox
(
dev
,
&
emr
.
rclBounds
);
EMFDRV_UpdateBBox
(
dev
,
&
emr
.
rclBounds
);
return
TRUE
;
return
TRUE
;
}
}
...
...
dlls/gdi32/gdi_private.h
View file @
54ec8602
...
@@ -337,7 +337,8 @@ typedef struct
...
@@ -337,7 +337,8 @@ typedef struct
/* path.c */
/* path.c */
extern
void
free_gdi_path
(
struct
gdi_path
*
path
)
DECLSPEC_HIDDEN
;
extern
void
free_gdi_path
(
struct
gdi_path
*
path
)
DECLSPEC_HIDDEN
;
extern
int
get_gdi_flat_path
(
HDC
hdc
,
POINT
**
points
,
BYTE
**
flags
,
HRGN
*
rgn
)
DECLSPEC_HIDDEN
;
extern
struct
gdi_path
*
get_gdi_flat_path
(
HDC
hdc
,
HRGN
*
rgn
)
DECLSPEC_HIDDEN
;
extern
int
get_gdi_path_data
(
struct
gdi_path
*
path
,
POINT
**
points
,
BYTE
**
flags
)
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
;
...
...
dlls/gdi32/path.c
View file @
54ec8602
...
@@ -514,29 +514,22 @@ static BOOL PATH_DoArcPart(struct gdi_path *pPath, FLOAT_POINT corners[],
...
@@ -514,29 +514,22 @@ static BOOL PATH_DoArcPart(struct gdi_path *pPath, FLOAT_POINT corners[],
}
}
/* retrieve a flattened path in device coordinates, and optionally its region */
/* retrieve a flattened path in device coordinates, and optionally its region */
/* the DC path is deleted; the returned data must be freed by caller */
/* the DC path is deleted; the returned data must be freed by caller
using free_gdi_path()
*/
/* helper for stroke_and_fill_path in the DIB driver */
/* helper for stroke_and_fill_path in the DIB driver */
int
get_gdi_flat_path
(
HDC
hdc
,
POINT
**
points
,
BYTE
**
flags
,
HRGN
*
rgn
)
struct
gdi_path
*
get_gdi_flat_path
(
HDC
hdc
,
HRGN
*
rgn
)
{
{
DC
*
dc
=
get_dc_ptr
(
hdc
);
DC
*
dc
=
get_dc_ptr
(
hdc
);
int
ret
=
-
1
;
struct
gdi_path
*
ret
=
NULL
;
if
(
!
dc
)
return
-
1
;
if
(
!
dc
)
return
NULL
;
if
(
dc
->
path
)
if
(
dc
->
path
)
{
{
struct
gdi_path
*
path
=
PATH_FlattenPath
(
dc
->
path
);
ret
=
PATH_FlattenPath
(
dc
->
path
);
free_gdi_path
(
dc
->
path
);
free_gdi_path
(
dc
->
path
);
dc
->
path
=
NULL
;
dc
->
path
=
NULL
;
if
(
path
)
if
(
ret
&&
rgn
)
*
rgn
=
path_to_region
(
ret
,
GetPolyFillMode
(
hdc
)
);
{
ret
=
path
->
count
;
*
points
=
path
->
points
;
*
flags
=
path
->
flags
;
if
(
rgn
)
*
rgn
=
path_to_region
(
path
,
GetPolyFillMode
(
hdc
));
HeapFree
(
GetProcessHeap
(),
0
,
path
);
}
}
}
else
SetLastError
(
ERROR_CAN_NOT_COMPLETE
);
else
SetLastError
(
ERROR_CAN_NOT_COMPLETE
);
...
@@ -544,6 +537,12 @@ int get_gdi_flat_path( HDC hdc, POINT **points, BYTE **flags, HRGN *rgn )
...
@@ -544,6 +537,12 @@ int get_gdi_flat_path( HDC hdc, POINT **points, BYTE **flags, HRGN *rgn )
return
ret
;
return
ret
;
}
}
int
get_gdi_path_data
(
struct
gdi_path
*
path
,
POINT
**
pts
,
BYTE
**
flags
)
{
*
pts
=
path
->
points
;
*
flags
=
path
->
flags
;
return
path
->
count
;
}
/***********************************************************************
/***********************************************************************
* BeginPath (GDI32.@)
* BeginPath (GDI32.@)
...
...
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