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
e1130cbb
Commit
e1130cbb
authored
Jul 29, 2016
by
Huw Davies
Committed by
Alexandre Julliard
Jul 29, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add an internal version of DPtoLP that takes a DC pointer.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
637c99f6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
20 deletions
+35
-20
clipping.c
dlls/gdi32/clipping.c
+1
-1
dc.c
dlls/gdi32/dc.c
+1
-1
font.c
dlls/gdi32/font.c
+11
-11
gdi_private.h
dlls/gdi32/gdi_private.h
+1
-0
mapping.c
dlls/gdi32/mapping.c
+20
-6
path.c
dlls/gdi32/path.c
+1
-1
No files found.
dlls/gdi32/clipping.c
View file @
e1130cbb
...
...
@@ -438,7 +438,7 @@ INT WINAPI GetClipBox( HDC hdc, LPRECT rect )
rect
->
left
=
rect
->
right
-
1
;
rect
->
right
=
tmp
-
1
;
}
DPtoLP
(
h
dc
,
(
LPPOINT
)
rect
,
2
);
dp_to_lp
(
dc
,
(
LPPOINT
)
rect
,
2
);
release_dc_ptr
(
dc
);
TRACE
(
"%p => %d %s
\n
"
,
hdc
,
ret
,
wine_dbgstr_rect
(
rect
));
return
ret
;
...
...
dlls/gdi32/dc.c
View file @
e1130cbb
...
...
@@ -1484,7 +1484,7 @@ UINT WINAPI GetBoundsRect(HDC hdc, LPRECT rect, UINT flags)
rect
->
bottom
=
min
(
rect
->
bottom
,
dc
->
vis_rect
.
bottom
-
dc
->
vis_rect
.
top
);
ret
=
DCB_SET
;
}
DPtoLP
(
h
dc
,
(
POINT
*
)
rect
,
2
);
dp_to_lp
(
dc
,
(
POINT
*
)
rect
,
2
);
}
else
ret
=
0
;
...
...
dlls/gdi32/font.c
View file @
e1130cbb
...
...
@@ -1901,7 +1901,7 @@ static RECT get_total_extents( HDC hdc, INT x, INT y, UINT flags, UINT aa_flags,
}
/* helper for nulldrv_ExtTextOut */
static
void
draw_glyph
(
HDC
h
dc
,
INT
origin_x
,
INT
origin_y
,
const
GLYPHMETRICS
*
metrics
,
static
void
draw_glyph
(
DC
*
dc
,
INT
origin_x
,
INT
origin_y
,
const
GLYPHMETRICS
*
metrics
,
const
struct
gdi_image_bits
*
image
,
const
RECT
*
clip
)
{
static
const
BYTE
masks
[
8
]
=
{
0x80
,
0x40
,
0x20
,
0x10
,
0x08
,
0x04
,
0x02
,
0x01
};
...
...
@@ -1941,8 +1941,8 @@ static void draw_glyph( HDC hdc, INT origin_x, INT origin_y, const GLYPHMETRICS
}
}
assert
(
count
<=
max_count
);
DPtoLP
(
h
dc
,
pts
,
count
);
for
(
i
=
0
;
i
<
count
;
i
+=
2
)
Polyline
(
hdc
,
pts
+
i
,
2
);
dp_to_lp
(
dc
,
pts
,
count
);
for
(
i
=
0
;
i
<
count
;
i
+=
2
)
Polyline
(
dc
->
hSelf
,
pts
+
i
,
2
);
HeapFree
(
GetProcessHeap
(),
0
,
pts
);
}
...
...
@@ -1966,7 +1966,7 @@ BOOL nulldrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *rect
if
(
brush
)
{
orig
=
SelectObject
(
dev
->
hdc
,
brush
);
DPtoLP
(
dev
->
h
dc
,
(
POINT
*
)
&
rc
,
2
);
dp_to_lp
(
dc
,
(
POINT
*
)
&
rc
,
2
);
PatBlt
(
dev
->
hdc
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
SelectObject
(
dev
->
hdc
,
orig
);
DeleteObject
(
brush
);
...
...
@@ -2063,7 +2063,7 @@ BOOL nulldrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *rect
err
=
get_glyph_bitmap
(
dev
->
hdc
,
str
[
i
],
flags
,
GGO_BITMAP
,
&
metrics
,
&
image
);
if
(
err
)
continue
;
if
(
image
.
ptr
)
draw_glyph
(
d
ev
->
hd
c
,
x
,
y
,
&
metrics
,
&
image
,
(
flags
&
ETO_CLIPPED
)
?
rect
:
NULL
);
if
(
image
.
ptr
)
draw_glyph
(
dc
,
x
,
y
,
&
metrics
,
&
image
,
(
flags
&
ETO_CLIPPED
)
?
rect
:
NULL
);
if
(
image
.
free
)
image
.
free
(
&
image
);
if
(
dx
)
...
...
@@ -2424,7 +2424,7 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
{
pt
.
x
=
x
+
width
.
x
;
pt
.
y
=
y
+
width
.
y
;
DPtoLP
(
h
dc
,
&
pt
,
1
);
dp_to_lp
(
dc
,
&
pt
,
1
);
MoveToEx
(
hdc
,
pt
.
x
,
pt
.
y
,
NULL
);
}
break
;
...
...
@@ -2441,7 +2441,7 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
{
pt
.
x
=
x
;
pt
.
y
=
y
;
DPtoLP
(
h
dc
,
&
pt
,
1
);
dp_to_lp
(
dc
,
&
pt
,
1
);
MoveToEx
(
hdc
,
pt
.
x
,
pt
.
y
,
NULL
);
}
break
;
...
...
@@ -2494,8 +2494,6 @@ done:
if
(
reordered_str
!=
str
)
HeapFree
(
GetProcessHeap
(),
0
,
reordered_str
);
release_dc_ptr
(
dc
);
if
(
ret
&&
(
lf
.
lfUnderline
||
lf
.
lfStrikeOut
))
{
int
underlinePos
,
strikeoutPos
;
...
...
@@ -2541,7 +2539,7 @@ done:
pts
[
3
].
y
=
pts
[
0
].
y
+
underlineWidth
*
cosEsc
;
pts
[
4
].
x
=
pts
[
0
].
x
;
pts
[
4
].
y
=
pts
[
0
].
y
;
DPtoLP
(
h
dc
,
pts
,
5
);
dp_to_lp
(
dc
,
pts
,
5
);
Polygon
(
hdc
,
pts
,
5
);
}
...
...
@@ -2557,7 +2555,7 @@ done:
pts
[
3
].
y
=
pts
[
0
].
y
+
strikeoutWidth
*
cosEsc
;
pts
[
4
].
x
=
pts
[
0
].
x
;
pts
[
4
].
y
=
pts
[
0
].
y
;
DPtoLP
(
h
dc
,
pts
,
5
);
dp_to_lp
(
dc
,
pts
,
5
);
Polygon
(
hdc
,
pts
,
5
);
}
...
...
@@ -2566,6 +2564,8 @@ done:
DeleteObject
(
hbrush
);
}
release_dc_ptr
(
dc
);
return
ret
;
}
...
...
dlls/gdi32/gdi_private.h
View file @
e1130cbb
...
...
@@ -304,6 +304,7 @@ extern void GDI_hdc_using_object(HGDIOBJ obj, HDC hdc) DECLSPEC_HIDDEN;
extern
void
GDI_hdc_not_using_object
(
HGDIOBJ
obj
,
HDC
hdc
)
DECLSPEC_HIDDEN
;
/* mapping.c */
extern
BOOL
dp_to_lp
(
DC
*
dc
,
POINT
*
points
,
INT
count
)
DECLSPEC_HIDDEN
;
extern
void
lp_to_dp
(
DC
*
dc
,
POINT
*
points
,
INT
count
)
DECLSPEC_HIDDEN
;
/* metafile.c */
...
...
dlls/gdi32/mapping.c
View file @
e1130cbb
...
...
@@ -306,13 +306,12 @@ BOOL nulldrv_SetWorldTransform( PHYSDEV dev, const XFORM *xform )
}
/***********************************************************************
* DPtoLP (GDI32.@)
* dp_to_lp
*
* Internal version of DPtoLP that takes a DC *.
*/
BOOL
WINAPI
DPtoLP
(
HDC
hdc
,
LPPOINT
points
,
INT
count
)
BOOL
dp_to_lp
(
DC
*
dc
,
POINT
*
points
,
INT
count
)
{
DC
*
dc
=
get_dc_ptr
(
hdc
);
if
(
!
dc
)
return
FALSE
;
if
(
dc
->
vport2WorldValid
)
{
while
(
count
--
)
...
...
@@ -328,10 +327,25 @@ BOOL WINAPI DPtoLP( HDC hdc, LPPOINT points, INT count )
points
++
;
}
}
release_dc_ptr
(
dc
);
return
(
count
<
0
);
}
/***********************************************************************
* DPtoLP (GDI32.@)
*/
BOOL
WINAPI
DPtoLP
(
HDC
hdc
,
POINT
*
points
,
INT
count
)
{
DC
*
dc
=
get_dc_ptr
(
hdc
);
BOOL
ret
;
if
(
!
dc
)
return
FALSE
;
ret
=
dp_to_lp
(
dc
,
points
,
count
);
release_dc_ptr
(
dc
);
return
ret
;
}
/***********************************************************************
* lp_to_dp
...
...
dlls/gdi32/path.c
View file @
e1130cbb
...
...
@@ -670,7 +670,7 @@ INT WINAPI GetPath(HDC hdc, LPPOINT pPoints, LPBYTE pTypes, INT nSize)
memcpy
(
pTypes
,
dc
->
path
->
flags
,
sizeof
(
BYTE
)
*
dc
->
path
->
count
);
/* Convert the points to logical coordinates */
if
(
!
DPtoLP
(
h
dc
,
pPoints
,
dc
->
path
->
count
))
if
(
!
dp_to_lp
(
dc
,
pPoints
,
dc
->
path
->
count
))
{
/* FIXME: Is this the correct value? */
SetLastError
(
ERROR_CAN_NOT_COMPLETE
);
...
...
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