Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5ece770d
Commit
5ece770d
authored
Apr 20, 2023
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Handle EMR_STRETCHDIBITS record in spool files.
parent
a3d1985c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
printproc.c
dlls/wineps.drv/printproc.c
+48
-0
No files found.
dlls/wineps.drv/printproc.c
View file @
5ece770d
...
...
@@ -888,6 +888,52 @@ static int set_di_bits_to_device(PHYSDEV dev, const EMRSETDIBITSTODEVICE *p)
return
1
;
}
static
int
stretch_di_bits
(
PHYSDEV
dev
,
const
EMRSTRETCHDIBITS
*
p
)
{
char
bi_buffer
[
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
])];
const
BYTE
*
bits
=
(
BYTE
*
)
p
+
p
->
offBitsSrc
;
BITMAPINFO
*
bi
=
(
BITMAPINFO
*
)
bi_buffer
;
EMRSTRETCHBLT
blt
;
memcpy
(
bi
,
(
BYTE
*
)
p
+
p
->
offBmiSrc
,
p
->
cbBmiSrc
);
memset
(
bi_buffer
+
p
->
cbBmiSrc
,
0
,
sizeof
(
bi_buffer
)
-
p
->
cbBmiSrc
);
if
(
p
->
iUsageSrc
==
DIB_PAL_COLORS
&&
(
bi
->
bmiHeader
.
biBitCount
==
1
||
bi
->
bmiHeader
.
biBitCount
==
4
||
bi
->
bmiHeader
.
biBitCount
==
8
))
{
PALETTEENTRY
pal
[
256
];
HPALETTE
hpal
;
UINT
i
,
size
;
hpal
=
GetCurrentObject
(
dev
->
hdc
,
OBJ_PAL
);
size
=
GetPaletteEntries
(
hpal
,
0
,
1
<<
bi
->
bmiHeader
.
biBitCount
,
pal
);
for
(
i
=
0
;
i
<
size
;
i
++
)
{
bi
->
bmiColors
[
i
].
rgbBlue
=
pal
[
i
].
peBlue
;
bi
->
bmiColors
[
i
].
rgbGreen
=
pal
[
i
].
peGreen
;
bi
->
bmiColors
[
i
].
rgbRed
=
pal
[
i
].
peRed
;
}
}
memset
(
&
blt
,
0
,
sizeof
(
blt
));
blt
.
rclBounds
=
p
->
rclBounds
;
blt
.
xDest
=
p
->
xDest
;
blt
.
yDest
=
p
->
yDest
;
blt
.
cxDest
=
p
->
cxDest
;
blt
.
cyDest
=
p
->
cyDest
;
blt
.
dwRop
=
p
->
dwRop
;
blt
.
xSrc
=
p
->
xSrc
;
blt
.
ySrc
=
abs
(
bi
->
bmiHeader
.
biHeight
)
-
p
->
ySrc
-
p
->
cySrc
;
blt
.
xformSrc
.
eM11
=
1
;
blt
.
xformSrc
.
eM22
=
1
;
blt
.
iUsageSrc
=
p
->
iUsageSrc
;
blt
.
cbBmiSrc
=
sizeof
(
bi_buffer
);
blt
.
cbBitsSrc
=
p
->
cbBitsSrc
;
blt
.
cxSrc
=
p
->
cxSrc
;
blt
.
cySrc
=
p
->
cySrc
;
return
stretch_blt
(
dev
,
&
blt
,
bi
,
bits
);
}
static
int
poly_draw
(
PHYSDEV
dev
,
const
POINT
*
points
,
const
BYTE
*
types
,
DWORD
count
)
{
POINT
first
,
cur
,
pts
[
4
];
...
...
@@ -2680,6 +2726,8 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
}
case
EMR_SETDIBITSTODEVICE
:
return
set_di_bits_to_device
(
&
data
->
pdev
->
dev
,
(
const
EMRSETDIBITSTODEVICE
*
)
rec
);
case
EMR_STRETCHDIBITS
:
return
stretch_di_bits
(
&
data
->
pdev
->
dev
,
(
const
EMRSTRETCHDIBITS
*
)
rec
);
case
EMR_EXTTEXTOUTW
:
{
const
EMREXTTEXTOUTW
*
p
=
(
const
EMREXTTEXTOUTW
*
)
rec
;
...
...
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