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
baceb8d0
Commit
baceb8d0
authored
Apr 21, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Return bitmask for 32-bit bitmaps too in GetDIBits.
parent
22d2abba
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
dib.c
dlls/gdi32/dib.c
+13
-5
bitmap.c
dlls/gdi32/tests/bitmap.c
+4
-2
No files found.
dlls/gdi32/dib.c
View file @
baceb8d0
...
...
@@ -640,19 +640,17 @@ INT WINAPI GetDIBits(
DIB_GetDIBImageBytes
(
bmp
->
bitmap
.
bmWidth
,
bmp
->
bitmap
.
bmHeight
,
bmp
->
bitmap
.
bmBitsPixel
);
info
->
bmiHeader
.
biCompression
=
(
bmp
->
bitmap
.
bmBitsPixel
>
8
)
?
BI_BITFIELDS
:
BI_RGB
;
switch
(
bmp
->
bitmap
.
bmBitsPixel
)
{
case
15
:
info
->
bmiHeader
.
biBitCount
=
16
;
info
->
bmiHeader
.
biCompression
=
BI_RGB
;
break
;
case
16
:
info
->
bmiHeader
.
biBitCount
=
16
;
info
->
bmiHeader
.
biCompression
=
BI_BITFIELDS
;
case
24
:
info
->
bmiHeader
.
biBitCount
=
32
;
break
;
default:
info
->
bmiHeader
.
biBitCount
=
bmp
->
bitmap
.
bmBitsPixel
;
info
->
bmiHeader
.
biCompression
=
BI_RGB
;
break
;
}
info
->
bmiHeader
.
biXPelsPerMeter
=
0
;
...
...
@@ -824,6 +822,16 @@ INT WINAPI GetDIBits(
((
PDWORD
)
info
->
bmiColors
)[
2
]
=
0x001f
;
}
break
;
case
24
:
case
32
:
if
(
info
->
bmiHeader
.
biCompression
==
BI_BITFIELDS
)
{
((
PDWORD
)
info
->
bmiColors
)[
0
]
=
0xff0000
;
((
PDWORD
)
info
->
bmiColors
)[
1
]
=
0x00ff00
;
((
PDWORD
)
info
->
bmiColors
)[
2
]
=
0x0000ff
;
}
break
;
}
if
(
bits
&&
lines
)
...
...
dlls/gdi32/tests/bitmap.c
View file @
baceb8d0
...
...
@@ -1623,11 +1623,13 @@ static void test_GetDIBits_BI_BITFIELDS(void)
/* Call GetDIBits to fill in bmiHeader. */
ret
=
GetDIBits
(
hdc
,
hbm
,
0
,
1
,
NULL
,
dibinfo
,
DIB_RGB_COLORS
);
ok
(
ret
==
1
,
"GetDIBits failed
\n
"
);
if
(
dibinfo
->
bmiHeader
.
biBitCount
==
16
&&
dibinfo
->
bmiHeader
.
biCompression
==
BI_BITFIELDS
)
if
(
dibinfo
->
bmiHeader
.
biBitCount
>
8
)
{
DWORD
*
bitmasks
=
(
DWORD
*
)
dibinfo
->
bmiColors
;
ok
(
dibinfo
->
bmiHeader
.
biCompression
==
BI_BITFIELDS
,
"compression is %u
\n
"
,
dibinfo
->
bmiHeader
.
biCompression
);
ok
(
!
bitmasks
[
0
],
"red mask is set
\n
"
);
ok
(
!
bitmasks
[
1
],
"green mask is set
\n
"
);
ok
(
!
bitmasks
[
2
],
"blue mask is set
\n
"
);
...
...
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