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
64ed5636
Commit
64ed5636
authored
Dec 28, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Use a region to render geometric and wide pens in PolyPolyline.
parent
9ee690c9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
20 deletions
+29
-20
dibdrv.h
dlls/gdi32/dibdrv/dibdrv.h
+1
-1
graphics.c
dlls/gdi32/dibdrv/graphics.c
+26
-19
objects.c
dlls/gdi32/dibdrv/objects.c
+2
-0
No files found.
dlls/gdi32/dibdrv/dibdrv.h
View file @
64ed5636
...
...
@@ -84,7 +84,7 @@ typedef struct dibdrv_physdev
/* pen */
COLORREF
pen_colorref
;
DWORD
pen_style
,
pen_endcap
,
pen_join
;
BOOL
pen_is_ext
;
BOOL
pen_
uses_region
,
pen_
is_ext
;
int
pen_width
;
dash_pattern
pen_pattern
;
dash_pos
dash_pos
;
...
...
dlls/gdi32/dibdrv/graphics.c
View file @
64ed5636
...
...
@@ -517,14 +517,27 @@ BOOL dibdrv_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* counts, DWO
PHYSDEV
next
=
GET_NEXT_PHYSDEV
(
dev
,
pPolyPolyline
);
DWORD
max_points
=
0
,
i
;
POINT
*
points
;
BOOL
ret
=
TRUE
;
INT
rop
=
GetROP2
(
dev
->
hdc
);
HRGN
outline
=
0
;
if
(
defer_pen
(
pdev
))
return
next
->
funcs
->
pPolyPolyline
(
next
,
pt
,
counts
,
polylines
);
for
(
i
=
0
;
i
<
polylines
;
i
++
)
max_points
=
max
(
counts
[
i
],
max_points
);
for
(
i
=
0
;
i
<
polylines
;
i
++
)
{
if
(
counts
[
i
]
<
2
)
return
FALSE
;
max_points
=
max
(
counts
[
i
],
max_points
);
}
points
=
HeapAlloc
(
GetProcessHeap
(),
0
,
max_points
*
sizeof
(
*
pt
)
);
if
(
!
points
)
return
FALSE
;
if
(
pdev
->
pen_uses_region
&&
!
(
outline
=
CreateRectRgn
(
0
,
0
,
0
,
0
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
points
);
return
FALSE
;
}
for
(
i
=
0
;
i
<
polylines
;
i
++
)
{
memcpy
(
points
,
pt
,
counts
[
i
]
*
sizeof
(
*
pt
)
);
...
...
@@ -532,11 +545,18 @@ BOOL dibdrv_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* counts, DWO
LPtoDP
(
dev
->
hdc
,
points
,
counts
[
i
]
);
reset_dash_origin
(
pdev
);
pdev
->
pen_lines
(
pdev
,
counts
[
i
],
points
,
FALSE
,
0
);
pdev
->
pen_lines
(
pdev
,
counts
[
i
],
points
,
FALSE
,
outline
);
}
if
(
outline
)
{
if
(
pdev
->
clip
)
CombineRgn
(
outline
,
outline
,
pdev
->
clip
,
RGN_AND
);
ret
=
pen_rect
(
pdev
,
NULL
,
outline
,
rop
);
DeleteObject
(
outline
);
}
HeapFree
(
GetProcessHeap
(),
0
,
points
);
return
TRUE
;
return
ret
;
}
/***********************************************************************
...
...
@@ -544,23 +564,10 @@ BOOL dibdrv_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* counts, DWO
*/
BOOL
dibdrv_Polyline
(
PHYSDEV
dev
,
const
POINT
*
pt
,
INT
count
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
PHYSDEV
next
=
GET_NEXT_PHYSDEV
(
dev
,
pPolyline
);
POINT
*
points
;
if
(
defer_pen
(
pdev
))
return
next
->
funcs
->
pPolyline
(
next
,
pt
,
count
);
points
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
sizeof
(
*
pt
)
);
if
(
!
points
)
return
FALSE
;
DWORD
counts
[
1
]
=
{
count
};
memcpy
(
points
,
pt
,
count
*
sizeof
(
*
pt
)
);
LPtoDP
(
dev
->
hdc
,
points
,
count
);
reset_dash_origin
(
pdev
);
pdev
->
pen_lines
(
pdev
,
count
,
points
,
FALSE
,
0
);
HeapFree
(
GetProcessHeap
(),
0
,
points
);
return
TRUE
;
if
(
count
<
0
)
return
FALSE
;
return
dibdrv_PolyPolyline
(
dev
,
pt
,
counts
,
1
);
}
/***********************************************************************
...
...
dlls/gdi32/dibdrv/objects.c
View file @
64ed5636
...
...
@@ -1615,6 +1615,7 @@ HPEN dibdrv_SelectPen( PHYSDEV dev, HPEN hpen )
break
;
case
PS_NULL
:
pdev
->
pen_width
=
0
;
pdev
->
pen_lines
=
null_pen_lines
;
pdev
->
defer
&=
~
DEFER_PEN
;
break
;
...
...
@@ -1637,6 +1638,7 @@ HPEN dibdrv_SelectPen( PHYSDEV dev, HPEN hpen )
break
;
}
pdev
->
pen_uses_region
=
(
logpen
.
lopnStyle
&
PS_GEOMETRIC
||
pdev
->
pen_width
>
1
);
pdev
->
pen_is_ext
=
(
elp
!=
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
elp
);
...
...
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