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
338539c7
Commit
338539c7
authored
Mar 29, 2008
by
Dan Kegel
Committed by
Alexandre Julliard
Mar 31, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Test retrieving BI_BITFIELDS info for 16bpp modes.
parent
a28b86a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
bitmap.c
dlls/gdi32/tests/bitmap.c
+57
-0
No files found.
dlls/gdi32/tests/bitmap.c
View file @
338539c7
...
...
@@ -1595,6 +1595,62 @@ todo_wine
ReleaseDC
(
0
,
hdc
);
}
static
void
test_GetDIBits_BI_BITFIELDS
(
void
)
{
/* Try a screen resolution detection technique
* from the September 1999 issue of Windows Developer's Journal
* which seems to be in widespread use.
* http://www.lesher.ws/highcolor.html
* http://www.lesher.ws/vidfmt.c
* It hinges on being able to retrieve the bitmaps
* for the three primary colors in nonpaletted 16 bit mode.
*/
char
dibinfo_buf
[
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
)];
LPBITMAPINFO
dibinfo
=
(
LPBITMAPINFO
)
dibinfo_buf
;
HDC
hdc
;
HBITMAP
hbm
;
int
ret
;
memset
(
dibinfo
,
0
,
sizeof
(
dibinfo_buf
));
dibinfo
->
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
hdc
=
GetDC
(
NULL
);
ok
(
hdc
!=
NULL
,
"GetDC failed?
\n
"
);
hbm
=
CreateCompatibleBitmap
(
hdc
,
1
,
1
);
ok
(
hbm
!=
NULL
,
"CreateCompatibleBitmap failed?
\n
"
);
/* 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
)
{
/* In the BITMAPINFOHEADER doc, this little struct is implicit.
* Making explicit for clarity.
*/
struct
bi_bitfields_s
{
DWORD
red
;
DWORD
blue
;
DWORD
green
;
}
*
bitmasks
;
/* Retrieve the BI_BITFIELDS info (requires second call, honest). */
ret
=
GetDIBits
(
hdc
,
hbm
,
0
,
1
,
NULL
,
dibinfo
,
DIB_RGB_COLORS
);
ok
(
ret
==
1
,
"GetDIBits failed
\n
"
);
bitmasks
=
(
struct
bi_bitfields_s
*
)
dibinfo
->
bmiColors
;
todo_wine
{
ok
(
bitmasks
->
red
!=
0
,
"expected space for red pixels
\n
"
);
ok
(
bitmasks
->
blue
!=
0
,
"expected space for blue pixels
\n
"
);
ok
(
bitmasks
->
green
!=
0
,
"expected space for green pixels
\n
"
);
}
}
else
{
skip
(
"not in 16 bpp BI_BITFIELDS mode, skipping that test
\n
"
);
}
DeleteObject
(
hbm
);
ReleaseDC
(
NULL
,
hdc
);
}
static
void
test_select_object
(
void
)
{
HDC
hdc
;
...
...
@@ -2036,6 +2092,7 @@ START_TEST(bitmap)
test_GetDIBits_selected_DDB
(
TRUE
);
test_GetDIBits_selected_DDB
(
FALSE
);
test_GetDIBits
();
test_GetDIBits_BI_BITFIELDS
();
test_select_object
();
test_CreateBitmap
();
test_GdiAlphaBlend
();
...
...
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