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
9efe66a8
Commit
9efe66a8
authored
Jul 27, 2016
by
Huw Davies
Committed by
Alexandre Julliard
Jul 27, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Use lp_to_dp() instead of LPtoDP() in the dib driver.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7fa6dfec
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
11 deletions
+18
-11
bitblt.c
dlls/gdi32/dibdrv/bitblt.c
+2
-1
graphics.c
dlls/gdi32/dibdrv/graphics.c
+12
-7
objects.c
dlls/gdi32/dibdrv/objects.c
+4
-3
No files found.
dlls/gdi32/dibdrv/bitblt.c
View file @
9efe66a8
...
...
@@ -1416,6 +1416,7 @@ BOOL dibdrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
void
*
grad_array
,
ULONG
ngrad
,
ULONG
mode
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
DC
*
dc
=
get_physdev_dc
(
dev
);
const
GRADIENT_TRIANGLE
*
tri
=
grad_array
;
const
GRADIENT_RECT
*
rect
=
grad_array
;
unsigned
int
i
;
...
...
@@ -1430,7 +1431,7 @@ BOOL dibdrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
pts
[
i
].
x
=
vert_array
[
i
].
x
;
pts
[
i
].
y
=
vert_array
[
i
].
y
;
}
LPtoDP
(
dev
->
h
dc
,
pts
,
nvert
);
lp_to_dp
(
dc
,
pts
,
nvert
);
switch
(
mode
)
{
...
...
dlls/gdi32/dibdrv/graphics.c
View file @
9efe66a8
...
...
@@ -1097,6 +1097,7 @@ COLORREF dibdrv_GetNearestColor( PHYSDEV dev, COLORREF color )
COLORREF
dibdrv_GetPixel
(
PHYSDEV
dev
,
INT
x
,
INT
y
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
DC
*
dc
=
get_physdev_dc
(
dev
);
POINT
pt
;
DWORD
pixel
;
...
...
@@ -1104,7 +1105,7 @@ COLORREF dibdrv_GetPixel( PHYSDEV dev, INT x, INT y )
pt
.
x
=
x
;
pt
.
y
=
y
;
LPtoDP
(
dev
->
h
dc
,
&
pt
,
1
);
lp_to_dp
(
dc
,
&
pt
,
1
);
if
(
pt
.
x
<
0
||
pt
.
x
>=
pdev
->
dib
.
rect
.
right
-
pdev
->
dib
.
rect
.
left
||
pt
.
y
<
0
||
pt
.
y
>=
pdev
->
dib
.
rect
.
bottom
-
pdev
->
dib
.
rect
.
top
)
...
...
@@ -1120,15 +1121,16 @@ COLORREF dibdrv_GetPixel( PHYSDEV dev, INT x, INT y )
BOOL
dibdrv_LineTo
(
PHYSDEV
dev
,
INT
x
,
INT
y
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
DC
*
dc
=
get_physdev_dc
(
dev
);
POINT
pts
[
2
];
HRGN
region
=
0
;
BOOL
ret
;
GetCurrentPositionEx
(
dev
->
hdc
,
pts
)
;
pts
[
0
]
=
dc
->
cur_pos
;
pts
[
1
].
x
=
x
;
pts
[
1
].
y
=
y
;
LPtoDP
(
dev
->
h
dc
,
pts
,
2
);
lp_to_dp
(
dc
,
pts
,
2
);
if
(
pdev
->
pen_uses_region
&&
!
(
region
=
CreateRectRgn
(
0
,
0
,
0
,
0
)))
return
FALSE
;
...
...
@@ -1229,6 +1231,7 @@ BOOL dibdrv_PaintRgn( PHYSDEV dev, HRGN rgn )
BOOL
dibdrv_PolyPolygon
(
PHYSDEV
dev
,
const
POINT
*
pt
,
const
INT
*
counts
,
DWORD
polygons
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
DC
*
dc
=
get_physdev_dc
(
dev
);
DWORD
total
,
i
,
pos
;
BOOL
ret
=
TRUE
;
POINT
*
points
;
...
...
@@ -1243,10 +1246,10 @@ BOOL dibdrv_PolyPolygon( PHYSDEV dev, const POINT *pt, const INT *counts, DWORD
points
=
HeapAlloc
(
GetProcessHeap
(),
0
,
total
*
sizeof
(
*
pt
)
);
if
(
!
points
)
return
FALSE
;
memcpy
(
points
,
pt
,
total
*
sizeof
(
*
pt
)
);
LPtoDP
(
dev
->
h
dc
,
points
,
total
);
lp_to_dp
(
dc
,
points
,
total
);
if
(
pdev
->
brush
.
style
!=
BS_NULL
&&
!
(
interior
=
CreatePolyPolygonRgn
(
points
,
counts
,
polygons
,
GetPolyFillMode
(
dev
->
hdc
)
)))
!
(
interior
=
CreatePolyPolygonRgn
(
points
,
counts
,
polygons
,
dc
->
polyFillMode
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
points
);
return
FALSE
;
...
...
@@ -1291,6 +1294,7 @@ BOOL dibdrv_PolyPolygon( PHYSDEV dev, const POINT *pt, const INT *counts, DWORD
BOOL
dibdrv_PolyPolyline
(
PHYSDEV
dev
,
const
POINT
*
pt
,
const
DWORD
*
counts
,
DWORD
polylines
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
DC
*
dc
=
get_physdev_dc
(
dev
);
DWORD
total
,
pos
,
i
;
POINT
*
points
;
BOOL
ret
=
TRUE
;
...
...
@@ -1305,7 +1309,7 @@ BOOL dibdrv_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* counts, DWO
points
=
HeapAlloc
(
GetProcessHeap
(),
0
,
total
*
sizeof
(
*
pt
)
);
if
(
!
points
)
return
FALSE
;
memcpy
(
points
,
pt
,
total
*
sizeof
(
*
pt
)
);
LPtoDP
(
dev
->
h
dc
,
points
,
total
);
lp_to_dp
(
dc
,
points
,
total
);
if
(
pdev
->
pen_uses_region
&&
!
(
outline
=
CreateRectRgn
(
0
,
0
,
0
,
0
)))
{
...
...
@@ -1555,6 +1559,7 @@ BOOL dibdrv_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
COLORREF
dibdrv_SetPixel
(
PHYSDEV
dev
,
INT
x
,
INT
y
,
COLORREF
color
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
DC
*
dc
=
get_physdev_dc
(
dev
);
struct
clipped_rects
clipped_rects
;
RECT
rect
;
POINT
pt
;
...
...
@@ -1564,7 +1569,7 @@ COLORREF dibdrv_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color )
pt
.
x
=
x
;
pt
.
y
=
y
;
LPtoDP
(
dev
->
h
dc
,
&
pt
,
1
);
lp_to_dp
(
dc
,
&
pt
,
1
);
rect
.
left
=
pt
.
x
;
rect
.
top
=
pt
.
y
;
rect
.
right
=
rect
.
left
+
1
;
...
...
dlls/gdi32/dibdrv/objects.c
View file @
9efe66a8
...
...
@@ -1726,14 +1726,14 @@ static inline void scale_dash_pattern( dash_pattern *pattern, DWORD scale, DWORD
}
}
static
inline
int
get_pen_device_width
(
dibdrv_physdev
*
pdev
,
int
width
)
static
inline
int
get_pen_device_width
(
DC
*
dc
,
int
width
)
{
POINT
pts
[
2
];
if
(
!
width
)
return
1
;
pts
[
0
].
x
=
pts
[
0
].
y
=
pts
[
1
].
y
=
0
;
pts
[
1
].
x
=
width
;
LPtoDP
(
pdev
->
dev
.
h
dc
,
pts
,
2
);
lp_to_dp
(
dc
,
pts
,
2
);
width
=
floor
(
hypot
(
pts
[
1
].
x
-
pts
[
0
].
x
,
pts
[
1
].
y
-
pts
[
0
].
y
));
return
max
(
width
,
1
);
}
...
...
@@ -2113,6 +2113,7 @@ HBRUSH dibdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush, const struct brush_patter
HPEN
dibdrv_SelectPen
(
PHYSDEV
dev
,
HPEN
hpen
,
const
struct
brush_pattern
*
pattern
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
DC
*
dc
=
get_physdev_dc
(
dev
);
LOGPEN
logpen
;
LOGBRUSH
logbrush
;
EXTLOGPEN
*
elp
=
NULL
;
...
...
@@ -2147,7 +2148,7 @@ HPEN dibdrv_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern *patte
pdev
->
pen_join
=
logpen
.
lopnStyle
&
PS_JOIN_MASK
;
pdev
->
pen_endcap
=
logpen
.
lopnStyle
&
PS_ENDCAP_MASK
;
pdev
->
pen_width
=
get_pen_device_width
(
pdev
,
logpen
.
lopnWidth
.
x
);
pdev
->
pen_width
=
get_pen_device_width
(
dc
,
logpen
.
lopnWidth
.
x
);
if
(
hpen
==
GetStockObject
(
DC_PEN
))
logbrush
.
lbColor
=
GetDCPenColor
(
dev
->
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