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
515b40c2
Commit
515b40c2
authored
May 02, 2008
by
Huw Davies
Committed by
Alexandre Julliard
May 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Rename DIB_BitmapInfoSize to bitmap_info_size and fix to take into account bit field masks.
parent
be900067
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
18 additions
and
17 deletions
+18
-17
brush.c
dlls/gdi32/brush.c
+1
-1
dib.c
dlls/gdi32/dib.c
+5
-4
bitblt.c
dlls/gdi32/enhmfdrv/bitblt.c
+2
-2
objects.c
dlls/gdi32/enhmfdrv/objects.c
+1
-1
gdi_private.h
dlls/gdi32/gdi_private.h
+1
-1
metafile.c
dlls/gdi32/metafile.c
+4
-4
bitblt.c
dlls/gdi32/mfdrv/bitblt.c
+3
-3
objects.c
dlls/gdi32/mfdrv/objects.c
+1
-1
No files found.
dlls/gdi32/brush.c
View file @
515b40c2
...
...
@@ -67,7 +67,7 @@ static HGLOBAL16 dib_copy(const BITMAPINFO *info, UINT coloruse)
size
=
DIB_GetDIBImageBytes
(
info
->
bmiHeader
.
biWidth
,
info
->
bmiHeader
.
biHeight
,
info
->
bmiHeader
.
biBitCount
);
size
+=
DIB_BitmapInfoS
ize
(
info
,
coloruse
);
size
+=
bitmap_info_s
ize
(
info
,
coloruse
);
if
(
!
(
hmem
=
GlobalAlloc16
(
GMEM_MOVEABLE
,
size
)))
{
...
...
dlls/gdi32/dib.c
View file @
515b40c2
...
...
@@ -117,13 +117,13 @@ int DIB_GetDIBImageBytes( int width, int height, int depth )
/***********************************************************************
*
DIB_BitmapInfoS
ize
*
bitmap_info_s
ize
*
* Return the size of the bitmap info structure including color table.
*/
int
DIB_BitmapInfoS
ize
(
const
BITMAPINFO
*
info
,
WORD
coloruse
)
int
bitmap_info_s
ize
(
const
BITMAPINFO
*
info
,
WORD
coloruse
)
{
int
colors
;
int
colors
,
masks
=
0
;
if
(
info
->
bmiHeader
.
biSize
==
sizeof
(
BITMAPCOREHEADER
))
{
...
...
@@ -138,7 +138,8 @@ int DIB_BitmapInfoSize( const BITMAPINFO * info, WORD coloruse )
if
(
colors
>
256
)
colors
=
256
;
if
(
!
colors
&&
(
info
->
bmiHeader
.
biBitCount
<=
8
))
colors
=
1
<<
info
->
bmiHeader
.
biBitCount
;
return
sizeof
(
BITMAPINFOHEADER
)
+
colors
*
if
(
info
->
bmiHeader
.
biCompression
==
BI_BITFIELDS
)
masks
=
3
;
return
sizeof
(
BITMAPINFOHEADER
)
+
masks
*
sizeof
(
DWORD
)
+
colors
*
((
coloruse
==
DIB_RGB_COLORS
)
?
sizeof
(
RGBQUAD
)
:
sizeof
(
WORD
));
}
}
...
...
dlls/gdi32/enhmfdrv/bitblt.c
View file @
515b40c2
...
...
@@ -206,7 +206,7 @@ INT EMFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst,
info
->
bmiHeader
.
biBitCount
);
/* calculate the size of the colour table */
bmi_size
=
DIB_BitmapInfoS
ize
(
info
,
wUsage
);
bmi_size
=
bitmap_info_s
ize
(
info
,
wUsage
);
emr_size
=
sizeof
(
EMRSTRETCHDIBITS
)
+
bmi_size
+
bits_size
;
emr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
emr_size
);
...
...
@@ -262,7 +262,7 @@ INT EMFDRV_SetDIBitsToDevice(
EMRSETDIBITSTODEVICE
*
pEMR
;
DWORD
size
,
bmiSize
,
bitsSize
;
bmiSize
=
DIB_BitmapInfoS
ize
(
info
,
wUsage
);
bmiSize
=
bitmap_info_s
ize
(
info
,
wUsage
);
bitsSize
=
DIB_GetDIBImageBytes
(
info
->
bmiHeader
.
biWidth
,
info
->
bmiHeader
.
biHeight
,
info
->
bmiHeader
.
biBitCount
);
...
...
dlls/gdi32/enhmfdrv/objects.c
View file @
515b40c2
...
...
@@ -174,7 +174,7 @@ DWORD EMFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush )
bmSize
=
DIB_GetDIBImageBytes
(
info
->
bmiHeader
.
biWidth
,
info
->
bmiHeader
.
biHeight
,
info
->
bmiHeader
.
biBitCount
);
biSize
=
DIB_BitmapInfoS
ize
(
info
,
LOWORD
(
logbrush
.
lbColor
));
biSize
=
bitmap_info_s
ize
(
info
,
LOWORD
(
logbrush
.
lbColor
));
size
=
sizeof
(
EMRCREATEDIBPATTERNBRUSHPT
)
+
biSize
+
bmSize
;
emr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
emr
)
break
;
...
...
dlls/gdi32/gdi_private.h
View file @
515b40c2
...
...
@@ -408,7 +408,7 @@ extern void DC_UpdateXforms( DC * dc ) DECLSPEC_HIDDEN;
/* dib.c */
extern
int
DIB_GetDIBWidthBytes
(
int
width
,
int
depth
)
DECLSPEC_HIDDEN
;
extern
int
DIB_GetDIBImageBytes
(
int
width
,
int
height
,
int
depth
)
DECLSPEC_HIDDEN
;
extern
int
DIB_BitmapInfoS
ize
(
const
BITMAPINFO
*
info
,
WORD
coloruse
)
DECLSPEC_HIDDEN
;
extern
int
bitmap_info_s
ize
(
const
BITMAPINFO
*
info
,
WORD
coloruse
)
DECLSPEC_HIDDEN
;
/* driver.c */
extern
const
DC_FUNCTIONS
*
DRIVER_load_driver
(
LPCWSTR
name
)
DECLSPEC_HIDDEN
;
...
...
dlls/gdi32/metafile.c
View file @
515b40c2
...
...
@@ -889,7 +889,7 @@ BOOL WINAPI PlayMetaFileRecord( HDC hdc, HANDLETABLE *ht, METARECORD *mr, UINT
case
META_STRETCHDIB
:
{
LPBITMAPINFO
info
=
(
LPBITMAPINFO
)
&
(
mr
->
rdParm
[
11
]);
LPSTR
bits
=
(
LPSTR
)
info
+
DIB_BitmapInfoS
ize
(
info
,
mr
->
rdParm
[
2
]
);
LPSTR
bits
=
(
LPSTR
)
info
+
bitmap_info_s
ize
(
info
,
mr
->
rdParm
[
2
]
);
StretchDIBits
(
hdc
,
(
SHORT
)
mr
->
rdParm
[
10
],
(
SHORT
)
mr
->
rdParm
[
9
],
(
SHORT
)
mr
->
rdParm
[
8
],
(
SHORT
)
mr
->
rdParm
[
7
],
(
SHORT
)
mr
->
rdParm
[
6
],
(
SHORT
)
mr
->
rdParm
[
5
],
(
SHORT
)
mr
->
rdParm
[
4
],
(
SHORT
)
mr
->
rdParm
[
3
],
bits
,
info
,
...
...
@@ -900,7 +900,7 @@ BOOL WINAPI PlayMetaFileRecord( HDC hdc, HANDLETABLE *ht, METARECORD *mr, UINT
case
META_DIBSTRETCHBLT
:
{
LPBITMAPINFO
info
=
(
LPBITMAPINFO
)
&
(
mr
->
rdParm
[
10
]);
LPSTR
bits
=
(
LPSTR
)
info
+
DIB_BitmapInfoS
ize
(
info
,
mr
->
rdParm
[
2
]
);
LPSTR
bits
=
(
LPSTR
)
info
+
bitmap_info_s
ize
(
info
,
mr
->
rdParm
[
2
]
);
StretchDIBits
(
hdc
,
(
SHORT
)
mr
->
rdParm
[
9
],
(
SHORT
)
mr
->
rdParm
[
8
],
(
SHORT
)
mr
->
rdParm
[
7
],
(
SHORT
)
mr
->
rdParm
[
6
],
(
SHORT
)
mr
->
rdParm
[
5
],
(
SHORT
)
mr
->
rdParm
[
4
],
(
SHORT
)
mr
->
rdParm
[
3
],
(
SHORT
)
mr
->
rdParm
[
2
],
bits
,
info
,
...
...
@@ -997,7 +997,7 @@ BOOL WINAPI PlayMetaFileRecord( HDC hdc, HANDLETABLE *ht, METARECORD *mr, UINT
if
(
mr
->
rdSize
>
12
)
{
LPBITMAPINFO
info
=
(
LPBITMAPINFO
)
&
(
mr
->
rdParm
[
8
]);
LPSTR
bits
=
(
LPSTR
)
info
+
DIB_BitmapInfoS
ize
(
info
,
mr
->
rdParm
[
0
]);
LPSTR
bits
=
(
LPSTR
)
info
+
bitmap_info_s
ize
(
info
,
mr
->
rdParm
[
0
]);
StretchDIBits
(
hdc
,
(
SHORT
)
mr
->
rdParm
[
7
],
(
SHORT
)
mr
->
rdParm
[
6
],
(
SHORT
)
mr
->
rdParm
[
5
],
(
SHORT
)
mr
->
rdParm
[
4
],
(
SHORT
)
mr
->
rdParm
[
3
],
(
SHORT
)
mr
->
rdParm
[
2
],
...
...
@@ -1027,7 +1027,7 @@ BOOL WINAPI PlayMetaFileRecord( HDC hdc, HANDLETABLE *ht, METARECORD *mr, UINT
case
META_SETDIBTODEV
:
{
BITMAPINFO
*
info
=
(
BITMAPINFO
*
)
&
(
mr
->
rdParm
[
9
]);
char
*
bits
=
(
char
*
)
info
+
DIB_BitmapInfoS
ize
(
info
,
mr
->
rdParm
[
0
]
);
char
*
bits
=
(
char
*
)
info
+
bitmap_info_s
ize
(
info
,
mr
->
rdParm
[
0
]
);
SetDIBitsToDevice
(
hdc
,
(
SHORT
)
mr
->
rdParm
[
8
],
(
SHORT
)
mr
->
rdParm
[
7
],
(
SHORT
)
mr
->
rdParm
[
6
],
(
SHORT
)
mr
->
rdParm
[
5
],
(
SHORT
)
mr
->
rdParm
[
4
],
(
SHORT
)
mr
->
rdParm
[
3
],
...
...
dlls/gdi32/mfdrv/bitblt.c
View file @
515b40c2
...
...
@@ -101,7 +101,7 @@ BOOL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst,
len
,
rop
,
lpBMI
->
biYPelsPerMeter
,
GetDeviceCaps
(
physDevSrc
->
hdc
,
LOGPIXELSY
));
if
(
GetDIBits
(
physDevSrc
->
hdc
,
hBitmap
,
0
,
(
UINT
)
lpBMI
->
biHeight
,
(
LPSTR
)
lpBMI
+
DIB_BitmapInfoS
ize
(
(
BITMAPINFO
*
)
lpBMI
,
(
LPSTR
)
lpBMI
+
bitmap_info_s
ize
(
(
BITMAPINFO
*
)
lpBMI
,
DIB_RGB_COLORS
),
(
LPBITMAPINFO
)
lpBMI
,
DIB_RGB_COLORS
))
#else
...
...
@@ -149,7 +149,7 @@ INT MFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst,
DWORD
len
,
infosize
,
imagesize
;
METARECORD
*
mr
;
infosize
=
DIB_BitmapInfoS
ize
(
info
,
wUsage
);
infosize
=
bitmap_info_s
ize
(
info
,
wUsage
);
imagesize
=
DIB_GetDIBImageBytes
(
info
->
bmiHeader
.
biWidth
,
info
->
bmiHeader
.
biHeight
,
info
->
bmiHeader
.
biBitCount
);
...
...
@@ -191,7 +191,7 @@ INT MFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDst, INT yDst, DWORD cx,
DWORD
len
,
infosize
,
imagesize
;
METARECORD
*
mr
;
infosize
=
DIB_BitmapInfoS
ize
(
info
,
coloruse
);
infosize
=
bitmap_info_s
ize
(
info
,
coloruse
);
imagesize
=
DIB_GetDIBImageBytes
(
info
->
bmiHeader
.
biWidth
,
info
->
bmiHeader
.
biHeight
,
info
->
bmiHeader
.
biBitCount
);
...
...
dlls/gdi32/mfdrv/objects.c
View file @
515b40c2
...
...
@@ -307,7 +307,7 @@ INT16 MFDRV_CreateBrushIndirect(PHYSDEV dev, HBRUSH hBrush )
bmSize
=
DIB_GetDIBImageBytes
(
info
->
bmiHeader
.
biWidth
,
info
->
bmiHeader
.
biHeight
,
info
->
bmiHeader
.
biBitCount
);
biSize
=
DIB_BitmapInfoS
ize
(
info
,
LOWORD
(
logbrush
.
lbColor
));
biSize
=
bitmap_info_s
ize
(
info
,
LOWORD
(
logbrush
.
lbColor
));
size
=
sizeof
(
METARECORD
)
+
biSize
+
bmSize
+
2
;
mr
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
if
(
!
mr
)
goto
done
;
...
...
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