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
53b1b034
Commit
53b1b034
authored
Apr 22, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr/tests: Simplify d3d9 device creation helper.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
895bb6f2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
26 deletions
+12
-26
evr.c
dlls/evr/tests/evr.c
+12
-26
No files found.
dlls/evr/tests/evr.c
View file @
53b1b034
...
...
@@ -49,10 +49,14 @@ static HWND create_window(void)
0
,
0
,
r
.
right
-
r
.
left
,
r
.
bottom
-
r
.
top
,
NULL
,
NULL
,
NULL
,
NULL
);
}
static
IDirect3DDevice9
*
create_device
(
IDirect3D9
*
d3d9
,
HWND
focus_window
)
static
IDirect3DDevice9
*
create_device
(
HWND
focus_window
)
{
D3DPRESENT_PARAMETERS
present_parameters
=
{
0
};
IDirect3DDevice9
*
device
=
NULL
;
IDirect3D9
*
d3d9
;
d3d9
=
Direct3DCreate9
(
D3D_SDK_VERSION
);
ok
(
!!
d3d9
,
"Failed to create a D3D object.
\n
"
);
present_parameters
.
BackBufferWidth
=
640
;
present_parameters
.
BackBufferHeight
=
480
;
...
...
@@ -66,6 +70,8 @@ static IDirect3DDevice9 *create_device(IDirect3D9 *d3d9, HWND focus_window)
IDirect3D9_CreateDevice
(
d3d9
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
focus_window
,
D3DCREATE_HARDWARE_VERTEXPROCESSING
,
&
present_parameters
,
&
device
);
IDirect3D9_Release
(
d3d9
);
return
device
;
}
...
...
@@ -719,16 +725,13 @@ static void test_surface_sample(void)
DWORD
flags
,
count
,
length
;
IDirect3DDevice9
*
device
;
IMFSample
*
sample
;
IDirect3D9
*
d3d
;
IUnknown
*
unk
;
HWND
window
;
HRESULT
hr
;
BYTE
*
data
;
window
=
create_window
();
d3d
=
Direct3DCreate9
(
D3D_SDK_VERSION
);
ok
(
!!
d3d
,
"Failed to create a D3D object.
\n
"
);
if
(
!
(
device
=
create_device
(
d3d
,
window
)))
if
(
!
(
device
=
create_device
(
window
)))
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
goto
done
;
...
...
@@ -930,7 +933,6 @@ static void test_surface_sample(void)
done:
if
(
backbuffer
)
IDirect3DSurface9_Release
(
backbuffer
);
IDirect3D9_Release
(
d3d
);
DestroyWindow
(
window
);
}
...
...
@@ -945,7 +947,6 @@ static void test_default_mixer_type_negotiation(void)
IMFTransform
*
transform
;
DWORD
index
,
count
;
GUID
guid
,
*
guids
;
IDirect3D9
*
d3d
;
IUnknown
*
unk
;
HWND
window
;
HRESULT
hr
;
...
...
@@ -981,9 +982,7 @@ static void test_default_mixer_type_negotiation(void)
/* Now try with device manager. */
window
=
create_window
();
d3d
=
Direct3DCreate9
(
D3D_SDK_VERSION
);
ok
(
!!
d3d
,
"Failed to create a D3D object.
\n
"
);
if
(
!
(
device
=
create_device
(
d3d
,
window
)))
if
(
!
(
device
=
create_device
(
window
)))
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
goto
done
;
...
...
@@ -1118,7 +1117,6 @@ todo_wine
done:
IMFTransform_Release
(
transform
);
IDirect3D9_Release
(
d3d
);
DestroyWindow
(
window
);
}
...
...
@@ -1341,7 +1339,6 @@ static void test_MFCreateVideoSampleAllocator(void)
LONG
refcount
,
count
;
unsigned
int
token
;
IMFGetService
*
gs
;
IDirect3D9
*
d3d
;
IUnknown
*
unk
;
HWND
window
;
HRESULT
hr
;
...
...
@@ -1456,9 +1453,7 @@ static void test_MFCreateVideoSampleAllocator(void)
/* Using device manager */
window
=
create_window
();
d3d
=
Direct3DCreate9
(
D3D_SDK_VERSION
);
ok
(
!!
d3d
,
"Failed to create a D3D object.
\n
"
);
if
(
!
(
device
=
create_device
(
d3d
,
window
)))
if
(
!
(
device
=
create_device
(
window
)))
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
goto
done
;
...
...
@@ -1507,7 +1502,6 @@ static void test_MFCreateVideoSampleAllocator(void)
IDirect3DDeviceManager9_Release
(
manager
);
IDirect3DDevice9_Release
(
device
);
done:
IDirect3D9_Release
(
d3d
);
DestroyWindow
(
window
);
}
...
...
@@ -2102,7 +2096,6 @@ static void test_presenter_media_type(void)
IDirect3DDeviceManager9
*
manager
;
HRESULT
hr
;
IMFTransform
*
mixer
;
IDirect3D9
*
d3d
;
IDirect3DDevice9
*
device
;
unsigned
int
token
;
SIZE
frame_size
;
...
...
@@ -2112,9 +2105,7 @@ static void test_presenter_media_type(void)
RECT
dst
;
window
=
create_window
();
d3d
=
Direct3DCreate9
(
D3D_SDK_VERSION
);
ok
(
!!
d3d
,
"Failed to create a D3D object.
\n
"
);
if
(
!
(
device
=
create_device
(
d3d
,
window
)))
if
(
!
(
device
=
create_device
(
window
)))
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
goto
done
;
...
...
@@ -2196,7 +2187,6 @@ todo_wine {
IMFTransform_Release
(
mixer
);
done:
IDirect3D9_Release
(
d3d
);
DestroyWindow
(
window
);
}
...
...
@@ -2439,16 +2429,13 @@ static void test_mixer_samples(void)
DWORD
count
,
flags
,
color
,
status
;
IMFTransform
*
mixer
;
IMFSample
*
sample
,
*
sample2
;
IDirect3D9
*
d3d
;
HWND
window
;
UINT
token
;
HRESULT
hr
;
LONGLONG
pts
,
duration
;
window
=
create_window
();
d3d
=
Direct3DCreate9
(
D3D_SDK_VERSION
);
ok
(
!!
d3d
,
"Failed to create a D3D object.
\n
"
);
if
(
!
(
device
=
create_device
(
d3d
,
window
)))
if
(
!
(
device
=
create_device
(
window
)))
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
goto
done
;
...
...
@@ -2678,7 +2665,6 @@ static void test_mixer_samples(void)
IDirect3DDeviceManager9_Release
(
manager
);
done:
IDirect3D9_Release
(
d3d
);
DestroyWindow
(
window
);
}
...
...
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