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
aa390e84
Commit
aa390e84
authored
Dec 07, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Dec 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32, winex11drv: Add a test for compatible bitmap depths.
parent
ab8deb27
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
15 deletions
+29
-15
bitmap.c
dlls/gdi32/tests/bitmap.c
+25
-11
bitmap.c
dlls/winex11.drv/bitmap.c
+4
-4
No files found.
dlls/gdi32/tests/bitmap.c
View file @
aa390e84
...
...
@@ -1555,7 +1555,8 @@ static void test_select_object(void)
{
HDC
hdc
;
HBITMAP
hbm
,
hbm_old
;
INT
planes
,
bpp
;
INT
planes
,
bpp
,
i
;
DWORD
depths
[]
=
{
8
,
15
,
16
,
24
,
32
};
hdc
=
GetDC
(
0
);
ok
(
hdc
!=
0
,
"GetDC(0) failed
\n
"
);
...
...
@@ -1594,17 +1595,30 @@ static void test_select_object(void)
DeleteObject
(
hbm
);
/* test a color bitmap that doesn't match the dc's bpp */
planes
=
GetDeviceCaps
(
hdc
,
PLANES
);
bpp
=
GetDeviceCaps
(
hdc
,
BITSPIXEL
)
==
24
?
8
:
24
;
hbm
=
CreateBitmap
(
10
,
10
,
planes
,
bpp
,
NULL
);
ok
(
hbm
!=
0
,
"CreateBitmap failed
\n
"
);
hbm_old
=
SelectObject
(
hdc
,
hbm
);
ok
(
hbm_old
==
0
,
"SelectObject should fail
\n
"
);
for
(
i
=
0
;
i
<
sizeof
(
depths
)
/
sizeof
(
depths
[
0
]);
i
++
)
{
/* test a color bitmap to dc bpp matching */
planes
=
GetDeviceCaps
(
hdc
,
PLANES
);
bpp
=
GetDeviceCaps
(
hdc
,
BITSPIXEL
);
hbm
=
CreateBitmap
(
10
,
10
,
planes
,
depths
[
i
],
NULL
);
ok
(
hbm
!=
0
,
"CreateBitmap failed
\n
"
);
hbm_old
=
SelectObject
(
hdc
,
hbm
);
if
(
depths
[
i
]
==
bpp
||
(
bpp
==
16
&&
depths
[
i
]
==
15
)
/* 16 and 15 bpp are compatible */
)
{
ok
(
hbm_old
!=
0
,
"SelectObject failed, BITSPIXEL: %d, created depth: %d
\n
"
,
bpp
,
depths
[
i
]);
SelectObject
(
hdc
,
hbm_old
);
}
else
{
if
(
bpp
==
24
&&
depths
[
i
]
==
32
)
{
todo_wine
ok
(
hbm_old
==
0
,
"SelectObject should fail. BITSPIXELS: %d, created depth: %d
\n
"
,
bpp
,
depths
[
i
]);
}
else
{
ok
(
hbm_old
==
0
,
"SelectObject should fail. BITSPIXELS: %d, created depth: %d
\n
"
,
bpp
,
depths
[
i
]);
}
}
DeleteObject
(
hbm
);
DeleteObject
(
hbm
);
}
DeleteDC
(
hdc
);
}
...
...
dlls/winex11.drv/bitmap.c
View file @
aa390e84
...
...
@@ -124,10 +124,10 @@ BOOL X11DRV_CreateBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, LPVOID bmBit
/* check if bpp is compatible with screen depth */
if
(
!
((
bitmap
.
bmBitsPixel
==
1
)
||
(
bitmap
.
bmBitsPixel
==
screen_depth
)
||
(
bitmap
.
bmBitsPixel
==
24
&&
screen_depth
==
32
)
||
(
bitmap
.
bmBitsPixel
==
32
&&
screen_depth
==
24
)
||
(
bitmap
.
bmBitsPixel
==
15
&&
screen_depth
==
16
)
||
(
bitmap
.
bmBitsPixel
==
16
&&
screen_depth
==
15
)))
(
bitmap
.
bmBitsPixel
==
24
&&
screen_depth
==
32
)
||
/* FIXME: Not compatible */
(
bitmap
.
bmBitsPixel
==
32
&&
screen_depth
==
24
)
||
/* FIXME: Not compatible */
(
bitmap
.
bmBitsPixel
==
15
&&
screen_depth
==
16
)
||
/* Confirmed by tests */
(
bitmap
.
bmBitsPixel
==
16
&&
screen_depth
==
15
)))
/* TODO: Confirm this */
{
ERR
(
"Trying to make bitmap with planes=%d, bpp=%d
\n
"
,
bitmap
.
bmPlanes
,
bitmap
.
bmBitsPixel
);
...
...
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