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
9d847413
Commit
9d847413
authored
Nov 24, 2004
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Nov 24, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid some direct accesses to DC internals from metafile driver.
parent
b3d64738
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
bitblt.c
dlls/gdi/mfdrv/bitblt.c
+13
-9
No files found.
dlls/gdi/mfdrv/bitblt.c
View file @
9d847413
...
@@ -65,12 +65,17 @@ BOOL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst,
...
@@ -65,12 +65,17 @@ BOOL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst,
METARECORD
*
mr
;
METARECORD
*
mr
;
BITMAP
BM
;
BITMAP
BM
;
METAFILEDRV_PDEVICE
*
physDevSrc
=
(
METAFILEDRV_PDEVICE
*
)
devSrc
;
METAFILEDRV_PDEVICE
*
physDevSrc
=
(
METAFILEDRV_PDEVICE
*
)
devSrc
;
DC
*
dcSrc
=
physDevSrc
->
dc
;
#ifdef STRETCH_VIA_DIB
#ifdef STRETCH_VIA_DIB
LPBITMAPINFOHEADER
lpBMI
;
LPBITMAPINFOHEADER
lpBMI
;
WORD
nBPP
;
WORD
nBPP
;
#endif
#endif
GetObjectA
(
dcSrc
->
hBitmap
,
sizeof
(
BITMAP
),
&
BM
);
HBITMAP
hBitmap
=
GetCurrentObject
(
physDevSrc
->
hdc
,
OBJ_BITMAP
);
if
(
GetObjectW
(
hBitmap
,
sizeof
(
BITMAP
),
&
BM
)
!=
sizeof
(
BITMAP
))
{
WARN
(
"bad bitmap object %p passed for hdc %p
\n
"
,
hBitmap
,
physDevSrc
->
hdc
);
return
FALSE
;
}
#ifdef STRETCH_VIA_DIB
#ifdef STRETCH_VIA_DIB
nBPP
=
BM
.
bmPlanes
*
BM
.
bmBitsPixel
;
nBPP
=
BM
.
bmPlanes
*
BM
.
bmBitsPixel
;
if
(
nBPP
>
8
)
nBPP
=
24
;
/* FIXME Can't get 16bpp to work for some reason */
if
(
nBPP
>
8
)
nBPP
=
24
;
/* FIXME Can't get 16bpp to work for some reason */
...
@@ -89,14 +94,14 @@ BOOL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst,
...
@@ -89,14 +94,14 @@ BOOL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst,
lpBMI
->
biSizeImage
=
DIB_GetDIBWidthBytes
(
BM
.
bmWidth
,
nBPP
)
*
lpBMI
->
biHeight
;
lpBMI
->
biSizeImage
=
DIB_GetDIBWidthBytes
(
BM
.
bmWidth
,
nBPP
)
*
lpBMI
->
biHeight
;
lpBMI
->
biClrUsed
=
nBPP
<=
8
?
1
<<
nBPP
:
0
;
lpBMI
->
biClrUsed
=
nBPP
<=
8
?
1
<<
nBPP
:
0
;
lpBMI
->
biCompression
=
BI_RGB
;
lpBMI
->
biCompression
=
BI_RGB
;
lpBMI
->
biXPelsPerMeter
=
MulDiv
(
GetDeviceCaps
(
dcSrc
->
hSelf
,
LOGPIXELSX
),
3937
,
100
);
lpBMI
->
biXPelsPerMeter
=
MulDiv
(
GetDeviceCaps
(
physDevSrc
->
hdc
,
LOGPIXELSX
),
3937
,
100
);
lpBMI
->
biYPelsPerMeter
=
MulDiv
(
GetDeviceCaps
(
dcSrc
->
hSelf
,
LOGPIXELSY
),
3937
,
100
);
lpBMI
->
biYPelsPerMeter
=
MulDiv
(
GetDeviceCaps
(
physDevSrc
->
hdc
,
LOGPIXELSY
),
3937
,
100
);
lpBMI
->
biClrImportant
=
0
;
/* 1 meter = 39.37 inch */
lpBMI
->
biClrImportant
=
0
;
/* 1 meter = 39.37 inch */
TRACE
(
"MF_StretchBltViaDIB->len = %ld rop=%lx PixYPM=%ld Caps=%d
\n
"
,
TRACE
(
"MF_StretchBltViaDIB->len = %ld rop=%lx PixYPM=%ld Caps=%d
\n
"
,
len
,
rop
,
lpBMI
->
biYPelsPerMeter
,
GetDeviceCaps
(
dcSrc
->
hSelf
,
len
,
rop
,
lpBMI
->
biYPelsPerMeter
,
GetDeviceCaps
(
physDevSrc
->
hdc
,
LOGPIXELSY
));
LOGPIXELSY
));
if
(
GetDIBits
(
dcSrc
->
hSelf
,
dcSrc
->
hBitmap
,
0
,
(
UINT
)
lpBMI
->
biHeight
,
if
(
GetDIBits
(
physDevSrc
->
hdc
,
hBitmap
,
0
,
(
UINT
)
lpBMI
->
biHeight
,
(
LPSTR
)
lpBMI
+
DIB_BitmapInfoSize
(
(
BITMAPINFO
*
)
lpBMI
,
(
LPSTR
)
lpBMI
+
DIB_BitmapInfoSize
(
(
BITMAPINFO
*
)
lpBMI
,
DIB_RGB_COLORS
),
DIB_RGB_COLORS
),
(
LPBITMAPINFO
)
lpBMI
,
DIB_RGB_COLORS
))
(
LPBITMAPINFO
)
lpBMI
,
DIB_RGB_COLORS
))
...
@@ -111,8 +116,7 @@ BOOL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst,
...
@@ -111,8 +116,7 @@ BOOL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst,
*
(
mr
->
rdParm
+
13
)
=
BM
.
bmPlanes
;
*
(
mr
->
rdParm
+
13
)
=
BM
.
bmPlanes
;
*
(
mr
->
rdParm
+
14
)
=
BM
.
bmBitsPixel
;
*
(
mr
->
rdParm
+
14
)
=
BM
.
bmBitsPixel
;
TRACE
(
"len = %ld rop=%lx
\n
"
,
len
,
rop
);
TRACE
(
"len = %ld rop=%lx
\n
"
,
len
,
rop
);
if
(
GetBitmapBits
(
dcSrc
->
hBitmap
,
BM
.
bmWidthBytes
*
BM
.
bmHeight
,
if
(
GetBitmapBits
(
hBitmap
,
BM
.
bmWidthBytes
*
BM
.
bmHeight
,
mr
->
rdParm
+
15
))
mr
->
rdParm
+
15
))
#endif
#endif
{
{
mr
->
rdSize
=
len
/
sizeof
(
INT16
);
mr
->
rdSize
=
len
/
sizeof
(
INT16
);
...
...
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