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
f825f5db
Commit
f825f5db
authored
Aug 04, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Create a sanitized BITMAPINFO in SetDIBitsToDevice and pass that to the drivers.
parent
d0d98046
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
137 deletions
+39
-137
dib.c
dlls/gdi32/dib.c
+4
-1
bitblt.c
dlls/gdi32/enhmfdrv/bitblt.c
+3
-4
bitblt.c
dlls/gdi32/mfdrv/bitblt.c
+2
-3
dib.c
dlls/winex11.drv/dib.c
+30
-129
No files found.
dlls/gdi32/dib.c
View file @
f825f5db
...
...
@@ -646,13 +646,16 @@ done:
*/
INT
WINAPI
SetDIBitsToDevice
(
HDC
hdc
,
INT
xDest
,
INT
yDest
,
DWORD
cx
,
DWORD
cy
,
INT
xSrc
,
INT
ySrc
,
UINT
startscan
,
UINT
lines
,
LPCVOID
bits
,
const
BITMAPINFO
*
info
,
UINT
lines
,
LPCVOID
bits
,
const
BITMAPINFO
*
bmi
,
UINT
coloruse
)
{
char
buffer
[
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
]
)];
BITMAPINFO
*
info
=
(
BITMAPINFO
*
)
buffer
;
INT
ret
=
0
;
DC
*
dc
;
if
(
!
bits
)
return
0
;
if
(
!
bitmapinfo_from_user_bitmapinfo
(
info
,
bmi
,
coloruse
))
return
0
;
if
((
dc
=
get_dc_ptr
(
hdc
)))
{
...
...
dlls/gdi32/enhmfdrv/bitblt.c
View file @
f825f5db
...
...
@@ -232,8 +232,7 @@ INT EMFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDst, INT yDst, DWORD width, DWOR
{
EMRSETDIBITSTODEVICE
*
pEMR
;
DWORD
bmiSize
=
bitmap_info_size
(
info
,
wUsage
);
DWORD
bitsSize
=
get_dib_image_size
(
info
);
DWORD
size
=
sizeof
(
EMRSETDIBITSTODEVICE
)
+
bmiSize
+
bitsSize
;
DWORD
size
=
sizeof
(
EMRSETDIBITSTODEVICE
)
+
bmiSize
+
info
->
bmiHeader
.
biSizeImage
;
pEMR
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
pEMR
)
return
0
;
...
...
@@ -253,12 +252,12 @@ INT EMFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDst, INT yDst, DWORD width, DWOR
pEMR
->
offBmiSrc
=
sizeof
(
EMRSETDIBITSTODEVICE
);
pEMR
->
cbBmiSrc
=
bmiSize
;
pEMR
->
offBitsSrc
=
sizeof
(
EMRSETDIBITSTODEVICE
)
+
bmiSize
;
pEMR
->
cbBitsSrc
=
bitsSiz
e
;
pEMR
->
cbBitsSrc
=
info
->
bmiHeader
.
biSizeImag
e
;
pEMR
->
iUsageSrc
=
wUsage
;
pEMR
->
iStartScan
=
startscan
;
pEMR
->
cScans
=
lines
;
memcpy
((
BYTE
*
)
pEMR
+
pEMR
->
offBmiSrc
,
info
,
bmiSize
);
memcpy
((
BYTE
*
)
pEMR
+
pEMR
->
offBitsSrc
,
bits
,
bitsSiz
e
);
memcpy
((
BYTE
*
)
pEMR
+
pEMR
->
offBitsSrc
,
bits
,
info
->
bmiHeader
.
biSizeImag
e
);
if
(
EMFDRV_WriteRecord
(
dev
,
(
EMR
*
)
pEMR
))
EMFDRV_UpdateBBox
(
dev
,
&
(
pEMR
->
rclBounds
));
...
...
dlls/gdi32/mfdrv/bitblt.c
View file @
f825f5db
...
...
@@ -171,8 +171,7 @@ INT MFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDst, INT yDst, DWORD cx,
{
DWORD
infosize
=
bitmap_info_size
(
info
,
coloruse
);
DWORD
imagesize
=
get_dib_image_size
(
info
);
DWORD
len
=
sizeof
(
METARECORD
)
+
8
*
sizeof
(
WORD
)
+
infosize
+
imagesize
;
DWORD
len
=
sizeof
(
METARECORD
)
+
8
*
sizeof
(
WORD
)
+
infosize
+
info
->
bmiHeader
.
biSizeImage
;
METARECORD
*
mr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
if
(
!
mr
)
return
0
;
...
...
@@ -188,7 +187,7 @@ INT MFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDst, INT yDst, DWORD cx,
mr
->
rdParm
[
7
]
=
(
INT16
)
yDst
;
mr
->
rdParm
[
8
]
=
(
INT16
)
xDst
;
memcpy
(
mr
->
rdParm
+
9
,
info
,
infosize
);
memcpy
(
mr
->
rdParm
+
9
+
infosize
/
2
,
bits
,
i
magesiz
e
);
memcpy
(
mr
->
rdParm
+
9
+
infosize
/
2
,
bits
,
i
nfo
->
bmiHeader
.
biSizeImag
e
);
MFDRV_WriteRecord
(
dev
,
mr
,
mr
->
rdSize
*
2
);
HeapFree
(
GetProcessHeap
(),
0
,
mr
);
return
lines
;
...
...
dlls/winex11.drv/dib.c
View file @
f825f5db
This diff is collapsed.
Click to expand it.
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