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
5535d834
Commit
5535d834
authored
Jan 20, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Test that presenting does not set the pixel format on a window without one.
parent
02b482f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
8 deletions
+64
-8
device.c
dlls/d3d9/tests/device.c
+64
-8
No files found.
dlls/d3d9/tests/device.c
View file @
5535d834
...
...
@@ -11050,10 +11050,12 @@ static void test_pixel_format(void)
PIXELFORMATDESCRIPTOR
pfd
;
IDirect3D9
*
d3d9
=
NULL
;
IDirect3DDevice9
*
device
=
NULL
;
HWND
hwnd
,
hwnd2
;
HDC
hdc
,
hdc2
;
HWND
hwnd
,
hwnd2
,
hwnd3
;
HDC
hdc
,
hdc2
,
hdc3
;
ULONG
refcount
;
HMODULE
gl
;
HRESULT
hr
;
BOOL
ret
;
static
const
float
point
[]
=
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
};
...
...
@@ -11152,14 +11154,68 @@ static void test_pixel_format(void)
test_format
=
GetPixelFormat
(
hdc2
);
ok
(
test_format
==
format
,
"second window has pixel format %d, expected %d
\n
"
,
test_format
,
format
);
cleanup:
if
(
device
)
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %lu references left.
\n
"
,
refcount
);
IDirect3D9_Release
(
d3d9
);
test_format
=
GetPixelFormat
(
hdc
);
ok
(
test_format
==
format
,
"window has pixel format %d, expected %d
\n
"
,
test_format
,
format
);
test_format
=
GetPixelFormat
(
hdc2
);
ok
(
test_format
==
format
,
"second window has pixel format %d, expected %d
\n
"
,
test_format
,
format
);
/* Test that creating a device doesn't set a pixel format on a window which
* never had one. */
hwnd3
=
create_window
();
hdc3
=
GetDC
(
hwnd3
);
test_format
=
GetPixelFormat
(
hdc3
);
ok
(
!
test_format
,
"Expected no format, got %d.
\n
"
,
test_format
);
d3d9
=
Direct3DCreate9
(
D3D_SDK_VERSION
);
ok
(
!!
d3d9
,
"Failed to create a D3D object.
\n
"
);
if
(
!
(
device
=
create_device
(
d3d9
,
hwnd3
,
NULL
)))
{
ULONG
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %lu references left.
\n
"
,
refcount
)
;
skip
(
"Failed to create device
\n
"
);
goto
cleanup
;
}
if
(
d3d9
)
IDirect3D9_Release
(
d3d9
);
hr
=
IDirect3DDevice9_SetFVF
(
device
,
D3DFVF_XYZ
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_BeginScene
(
device
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_DrawPrimitiveUP
(
device
,
D3DPT_POINTLIST
,
1
,
point
,
3
*
sizeof
(
float
));
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_EndScene
(
device
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
test_format
=
GetPixelFormat
(
hdc3
);
todo_wine
ok
(
!
test_format
,
"Expected no format, got %d.
\n
"
,
test_format
);
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
test_format
=
GetPixelFormat
(
hdc3
);
todo_wine
ok
(
!
test_format
,
"Expected no format, got %d.
\n
"
,
test_format
);
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %lu references left.
\n
"
,
refcount
);
IDirect3D9_Release
(
d3d9
);
test_format
=
GetPixelFormat
(
hdc3
);
todo_wine
ok
(
!
test_format
,
"Expected no format, got %d.
\n
"
,
test_format
);
ret
=
SetPixelFormat
(
hdc3
,
format
,
&
pfd
);
ok
(
ret
,
"Failed to set pixel format %d.
\n
"
,
format
);
test_format
=
GetPixelFormat
(
hdc3
);
ok
(
test_format
==
format
,
"Expected pixel format %d, got %d.
\n
"
,
format
,
test_format
);
ReleaseDC
(
hwnd3
,
hdc3
);
DestroyWindow
(
hwnd3
);
cleanup:
FreeLibrary
(
gl
);
ReleaseDC
(
hwnd2
,
hdc2
);
ReleaseDC
(
hwnd
,
hdc
);
...
...
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