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
e161c12e
Commit
e161c12e
authored
Aug 28, 2002
by
Huw D M Davies
Committed by
Alexandre Julliard
Aug 28, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BitBlt and StretchBlt generate META_DIBSTRETCHBLT records.
parent
b1f23259
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
43 deletions
+11
-43
bitblt.c
dlls/gdi/mfdrv/bitblt.c
+11
-43
No files found.
dlls/gdi/mfdrv/bitblt.c
View file @
e161c12e
...
...
@@ -43,41 +43,8 @@ BOOL MFDRV_PatBlt( PHYSDEV dev, INT left, INT top, INT width, INT height, DWORD
BOOL
MFDRV_BitBlt
(
PHYSDEV
devDst
,
INT
xDst
,
INT
yDst
,
INT
width
,
INT
height
,
PHYSDEV
devSrc
,
INT
xSrc
,
INT
ySrc
,
DWORD
rop
)
{
BOOL
ret
;
DWORD
len
;
METARECORD
*
mr
;
BITMAP
BM
;
METAFILEDRV_PDEVICE
*
physDevSrc
=
(
METAFILEDRV_PDEVICE
*
)
devSrc
;
DC
*
dcSrc
=
physDevSrc
->
dc
;
GetObjectA
(
dcSrc
->
hBitmap
,
sizeof
(
BITMAP
),
&
BM
);
len
=
sizeof
(
METARECORD
)
+
12
*
sizeof
(
INT16
)
+
BM
.
bmWidthBytes
*
BM
.
bmHeight
;
if
(
!
(
mr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
return
FALSE
;
mr
->
rdFunction
=
META_BITBLT
;
*
(
mr
->
rdParm
+
7
)
=
BM
.
bmWidth
;
*
(
mr
->
rdParm
+
8
)
=
BM
.
bmHeight
;
*
(
mr
->
rdParm
+
9
)
=
BM
.
bmWidthBytes
;
*
(
mr
->
rdParm
+
10
)
=
BM
.
bmPlanes
;
*
(
mr
->
rdParm
+
11
)
=
BM
.
bmBitsPixel
;
TRACE
(
"len = %ld rop=%lx
\n
"
,
len
,
rop
);
if
(
GetBitmapBits
(
dcSrc
->
hBitmap
,
BM
.
bmWidthBytes
*
BM
.
bmHeight
,
mr
->
rdParm
+
12
))
{
mr
->
rdSize
=
len
/
sizeof
(
INT16
);
*
(
mr
->
rdParm
)
=
HIWORD
(
rop
);
*
(
mr
->
rdParm
+
1
)
=
ySrc
;
*
(
mr
->
rdParm
+
2
)
=
xSrc
;
*
(
mr
->
rdParm
+
3
)
=
height
;
*
(
mr
->
rdParm
+
4
)
=
width
;
*
(
mr
->
rdParm
+
5
)
=
yDst
;
*
(
mr
->
rdParm
+
6
)
=
xDst
;
ret
=
MFDRV_WriteRecord
(
devDst
,
mr
,
mr
->
rdSize
*
2
);
}
else
ret
=
FALSE
;
HeapFree
(
GetProcessHeap
(),
0
,
mr
);
return
ret
;
return
MFDRV_StretchBlt
(
devDst
,
xDst
,
yDst
,
width
,
height
,
devSrc
,
xSrc
,
ySrc
,
width
,
height
,
rop
);
}
...
...
@@ -89,7 +56,6 @@ BOOL MFDRV_BitBlt( PHYSDEV devDst, INT xDst, INT yDst, INT width, INT height,
* via #define STRETCH_VIA_DIB
*/
#define STRETCH_VIA_DIB
#undef STRETCH_VIA_DIB
BOOL
MFDRV_StretchBlt
(
PHYSDEV
devDst
,
INT
xDst
,
INT
yDst
,
INT
widthDst
,
INT
heightDst
,
PHYSDEV
devSrc
,
INT
xSrc
,
INT
ySrc
,
...
...
@@ -108,9 +74,10 @@ BOOL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst,
GetObjectA
(
dcSrc
->
hBitmap
,
sizeof
(
BITMAP
),
&
BM
);
#ifdef STRETCH_VIA_DIB
nBPP
=
BM
.
bmPlanes
*
BM
.
bmBitsPixel
;
if
(
nBPP
>
8
)
nBPP
=
24
;
/* FIXME Can't get 16bpp to work for some reason */
len
=
sizeof
(
METARECORD
)
+
10
*
sizeof
(
INT16
)
+
sizeof
(
BITMAPINFOHEADER
)
+
(
nBPP
!=
24
?
1
<<
nBPP
:
0
)
*
sizeof
(
RGBQUAD
)
+
((
BM
.
bmWidth
*
nBPP
+
31
)
/
32
)
*
4
*
BM
.
bmHeight
;
+
sizeof
(
BITMAPINFOHEADER
)
+
(
nBPP
<=
8
?
1
<<
nBPP
:
0
)
*
sizeof
(
RGBQUAD
)
+
DIB_GetDIBWidthBytes
(
BM
.
bmWidth
,
nBPP
)
*
BM
.
bmHeight
;
if
(
!
(
mr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
return
FALSE
;
mr
->
rdFunction
=
META_DIBSTRETCHBLT
;
...
...
@@ -119,17 +86,18 @@ BOOL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst,
lpBMI
->
biWidth
=
BM
.
bmWidth
;
lpBMI
->
biHeight
=
BM
.
bmHeight
;
lpBMI
->
biPlanes
=
1
;
lpBMI
->
biBitCount
=
nBPP
;
/* 1,4,8 or 24 */
lpBMI
->
bi
ClrUsed
=
nBPP
!=
24
?
1
<<
nBPP
:
0
;
lpBMI
->
bi
SizeImage
=
((
lpBMI
->
biWidth
*
nBPP
+
31
)
/
32
)
*
4
*
lpBMI
->
biHeight
;
lpBMI
->
biBitCount
=
nBPP
;
lpBMI
->
bi
SizeImage
=
DIB_GetDIBWidthBytes
(
BM
.
bmWidth
,
nBPP
)
*
lpBMI
->
biHeight
;
lpBMI
->
bi
ClrUsed
=
nBPP
<=
8
?
1
<<
nBPP
:
0
;
lpBMI
->
biCompression
=
BI_RGB
;
lpBMI
->
biXPelsPerMeter
=
MulDiv
(
GetDeviceCaps
(
dcSrc
->
hSelf
,
LOGPIXELSX
),
3937
,
100
);
lpBMI
->
biYPelsPerMeter
=
MulDiv
(
GetDeviceCaps
(
dcSrc
->
hSelf
,
LOGPIXELSY
),
3937
,
100
);
lpBMI
->
biClrImportant
=
0
;
/* 1 meter = 39.37 inch */
TRACE
(
"MF_StretchBltViaDIB->len = %ld rop=%lx PixYPM=%ld Caps=%d
\n
"
,
len
,
rop
,
lpBMI
->
biYPelsPerMeter
,
GetDeviceCaps
(
hdcSrc
,
LOGPIXELSY
));
if
(
GetDIBits
(
hdcSrc
,
dcSrc
->
w
.
hBitmap
,
0
,(
UINT
)
lpBMI
->
biHeight
,
len
,
rop
,
lpBMI
->
biYPelsPerMeter
,
GetDeviceCaps
(
dcSrc
->
hSelf
,
LOGPIXELSY
));
if
(
GetDIBits
(
dcSrc
->
hSelf
,
dcSrc
->
hBitmap
,
0
,(
UINT
)
lpBMI
->
biHeight
,
(
LPSTR
)
lpBMI
+
DIB_BitmapInfoSize
(
(
BITMAPINFO
*
)
lpBMI
,
DIB_RGB_COLORS
),
(
LPBITMAPINFO
)
lpBMI
,
DIB_RGB_COLORS
))
...
...
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