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
2b31cac6
Commit
2b31cac6
authored
Nov 11, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Nov 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Allow passing a resolution to reset_device.
parent
bc47d492
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
20 deletions
+38
-20
device.c
dlls/d3d8/tests/device.c
+38
-20
No files found.
dlls/d3d8/tests/device.c
View file @
2b31cac6
...
@@ -136,19 +136,27 @@ static IDirect3DDevice8 *create_device(IDirect3D8 *d3d8, HWND focus_window, cons
...
@@ -136,19 +136,27 @@ static IDirect3DDevice8 *create_device(IDirect3D8 *d3d8, HWND focus_window, cons
return
NULL
;
return
NULL
;
}
}
static
HRESULT
reset_device
(
IDirect3DDevice8
*
device
,
HWND
device_window
,
BOOL
windowed
)
static
HRESULT
reset_device
(
IDirect3DDevice8
*
device
,
const
struct
device_desc
*
desc
)
{
{
D3DPRESENT_PARAMETERS
present_parameters
=
{
0
};
D3DPRESENT_PARAMETERS
present_parameters
=
{
0
};
present_parameters
.
Windowed
=
windowed
;
present_parameters
.
BackBufferWidth
=
640
;
present_parameters
.
hDeviceWindow
=
device_window
;
present_parameters
.
BackBufferHeight
=
480
;
present_parameters
.
SwapEffect
=
D3DSWAPEFFECT_DISCARD
;
present_parameters
.
BackBufferWidth
=
registry_mode
.
dmPelsWidth
;
present_parameters
.
BackBufferHeight
=
registry_mode
.
dmPelsHeight
;
present_parameters
.
BackBufferFormat
=
D3DFMT_A8R8G8B8
;
present_parameters
.
BackBufferFormat
=
D3DFMT_A8R8G8B8
;
present_parameters
.
SwapEffect
=
D3DSWAPEFFECT_DISCARD
;
present_parameters
.
hDeviceWindow
=
NULL
;
present_parameters
.
Windowed
=
TRUE
;
present_parameters
.
EnableAutoDepthStencil
=
TRUE
;
present_parameters
.
EnableAutoDepthStencil
=
TRUE
;
present_parameters
.
AutoDepthStencilFormat
=
D3DFMT_D24S8
;
present_parameters
.
AutoDepthStencilFormat
=
D3DFMT_D24S8
;
if
(
desc
)
{
present_parameters
.
BackBufferWidth
=
desc
->
width
;
present_parameters
.
BackBufferHeight
=
desc
->
height
;
present_parameters
.
hDeviceWindow
=
desc
->
device_window
;
present_parameters
.
Windowed
=
!
(
desc
->
flags
&
CREATE_DEVICE_FULLSCREEN
);
}
return
IDirect3DDevice8_Reset
(
device
,
&
present_parameters
);
return
IDirect3DDevice8_Reset
(
device
,
&
present_parameters
);
}
}
...
@@ -2424,8 +2432,8 @@ static void test_wndproc_windowed(void)
...
@@ -2424,8 +2432,8 @@ static void test_wndproc_windowed(void)
filter_messages
=
focus_window
;
filter_messages
=
focus_window
;
device_desc
.
device_window
=
device_window
;
device_desc
.
device_window
=
device_window
;
device_desc
.
width
=
640
;
device_desc
.
width
=
registry_mode
.
dmPelsWidth
;
device_desc
.
height
=
480
;
device_desc
.
height
=
registry_mode
.
dmPelsHeight
;
device_desc
.
flags
=
0
;
device_desc
.
flags
=
0
;
if
(
!
(
device
=
create_device
(
d3d8
,
focus_window
,
&
device_desc
)))
if
(
!
(
device
=
create_device
(
d3d8
,
focus_window
,
&
device_desc
)))
{
{
...
@@ -2449,7 +2457,8 @@ static void test_wndproc_windowed(void)
...
@@ -2449,7 +2457,8 @@ static void test_wndproc_windowed(void)
filter_messages
=
NULL
;
filter_messages
=
NULL
;
hr
=
reset_device
(
device
,
device_window
,
FALSE
);
device_desc
.
flags
=
CREATE_DEVICE_FULLSCREEN
;
hr
=
reset_device
(
device
,
&
device_desc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
proc
=
GetWindowLongPtrA
(
device_window
,
GWLP_WNDPROC
);
proc
=
GetWindowLongPtrA
(
device_window
,
GWLP_WNDPROC
);
...
@@ -2459,7 +2468,8 @@ static void test_wndproc_windowed(void)
...
@@ -2459,7 +2468,8 @@ static void test_wndproc_windowed(void)
proc
=
GetWindowLongPtrA
(
focus_window
,
GWLP_WNDPROC
);
proc
=
GetWindowLongPtrA
(
focus_window
,
GWLP_WNDPROC
);
ok
(
proc
!=
(
LONG_PTR
)
test_proc
,
"Expected wndproc != %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
);
ok
(
proc
!=
(
LONG_PTR
)
test_proc
,
"Expected wndproc != %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
);
hr
=
reset_device
(
device
,
device_window
,
TRUE
);
device_desc
.
flags
=
0
;
hr
=
reset_device
(
device
,
&
device_desc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
proc
=
GetWindowLongPtrA
(
device_window
,
GWLP_WNDPROC
);
proc
=
GetWindowLongPtrA
(
device_window
,
GWLP_WNDPROC
);
...
@@ -2486,7 +2496,8 @@ static void test_wndproc_windowed(void)
...
@@ -2486,7 +2496,8 @@ static void test_wndproc_windowed(void)
filter_messages
=
NULL
;
filter_messages
=
NULL
;
hr
=
reset_device
(
device
,
focus_window
,
FALSE
);
device_desc
.
flags
=
CREATE_DEVICE_FULLSCREEN
;
hr
=
reset_device
(
device
,
&
device_desc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
proc
=
GetWindowLongPtrA
(
device_window
,
GWLP_WNDPROC
);
proc
=
GetWindowLongPtrA
(
device_window
,
GWLP_WNDPROC
);
...
@@ -2496,7 +2507,8 @@ static void test_wndproc_windowed(void)
...
@@ -2496,7 +2507,8 @@ static void test_wndproc_windowed(void)
proc
=
GetWindowLongPtrA
(
focus_window
,
GWLP_WNDPROC
);
proc
=
GetWindowLongPtrA
(
focus_window
,
GWLP_WNDPROC
);
ok
(
proc
!=
(
LONG_PTR
)
test_proc
,
"Expected wndproc != %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
);
ok
(
proc
!=
(
LONG_PTR
)
test_proc
,
"Expected wndproc != %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
);
hr
=
reset_device
(
device
,
focus_window
,
TRUE
);
device_desc
.
flags
=
0
;
hr
=
reset_device
(
device
,
&
device_desc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
proc
=
GetWindowLongPtrA
(
device_window
,
GWLP_WNDPROC
);
proc
=
GetWindowLongPtrA
(
device_window
,
GWLP_WNDPROC
);
...
@@ -2521,7 +2533,8 @@ static void test_wndproc_windowed(void)
...
@@ -2521,7 +2533,8 @@ static void test_wndproc_windowed(void)
filter_messages
=
NULL
;
filter_messages
=
NULL
;
hr
=
reset_device
(
device
,
device_window
,
FALSE
);
device_desc
.
flags
=
CREATE_DEVICE_FULLSCREEN
;
hr
=
reset_device
(
device
,
&
device_desc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
proc
=
GetWindowLongPtrA
(
device_window
,
GWLP_WNDPROC
);
proc
=
GetWindowLongPtrA
(
device_window
,
GWLP_WNDPROC
);
...
@@ -2531,7 +2544,8 @@ static void test_wndproc_windowed(void)
...
@@ -2531,7 +2544,8 @@ static void test_wndproc_windowed(void)
proc
=
GetWindowLongPtrA
(
focus_window
,
GWLP_WNDPROC
);
proc
=
GetWindowLongPtrA
(
focus_window
,
GWLP_WNDPROC
);
ok
(
proc
!=
(
LONG_PTR
)
test_proc
,
"Expected wndproc != %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
);
ok
(
proc
!=
(
LONG_PTR
)
test_proc
,
"Expected wndproc != %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
);
hr
=
reset_device
(
device
,
device_window
,
TRUE
);
device_desc
.
flags
=
0
;
hr
=
reset_device
(
device
,
&
device_desc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
proc
=
GetWindowLongPtrA
(
device_window
,
GWLP_WNDPROC
);
proc
=
GetWindowLongPtrA
(
device_window
,
GWLP_WNDPROC
);
...
@@ -2830,7 +2844,8 @@ static void test_window_style(void)
...
@@ -2830,7 +2844,8 @@ static void test_window_style(void)
focus_rect
.
left
,
focus_rect
.
top
,
focus_rect
.
right
,
focus_rect
.
bottom
,
focus_rect
.
left
,
focus_rect
.
top
,
focus_rect
.
right
,
focus_rect
.
bottom
,
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
);
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
);
hr
=
reset_device
(
device
,
device_window
,
TRUE
);
device_desc
.
flags
=
0
;
hr
=
reset_device
(
device
,
&
device_desc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
style
=
GetWindowLongA
(
device_window
,
GWL_STYLE
);
style
=
GetWindowLongA
(
device_window
,
GWL_STYLE
);
...
@@ -3205,7 +3220,8 @@ static void test_device_window_reset(void)
...
@@ -3205,7 +3220,8 @@ static void test_device_window_reset(void)
proc
=
GetWindowLongPtrA
(
focus_window
,
GWLP_WNDPROC
);
proc
=
GetWindowLongPtrA
(
focus_window
,
GWLP_WNDPROC
);
ok
(
proc
!=
(
LONG_PTR
)
test_proc
,
"Expected wndproc != %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
);
ok
(
proc
!=
(
LONG_PTR
)
test_proc
,
"Expected wndproc != %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
);
hr
=
reset_device
(
device
,
device_window
,
FALSE
);
device_desc
.
device_window
=
device_window
;
hr
=
reset_device
(
device
,
&
device_desc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device.
\n
"
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device.
\n
"
);
GetWindowRect
(
focus_window
,
&
r
);
GetWindowRect
(
focus_window
,
&
r
);
...
@@ -3340,7 +3356,7 @@ static void test_reset_resources(void)
...
@@ -3340,7 +3356,7 @@ static void test_reset_resources(void)
IDirect3DSurface8_Release
(
rt
);
IDirect3DSurface8_Release
(
rt
);
IDirect3DSurface8_Release
(
surface
);
IDirect3DSurface8_Release
(
surface
);
hr
=
reset_device
(
device
,
device_window
,
TRUE
);
hr
=
reset_device
(
device
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device.
\n
"
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device.
\n
"
);
hr
=
IDirect3DDevice8_GetBackBuffer
(
device
,
0
,
D3DBACKBUFFER_TYPE_MONO
,
&
rt
);
hr
=
IDirect3DDevice8_GetBackBuffer
(
device
,
0
,
D3DBACKBUFFER_TYPE_MONO
,
&
rt
);
...
@@ -6506,14 +6522,15 @@ static void test_lost_device(void)
...
@@ -6506,14 +6522,15 @@ static void test_lost_device(void)
hr
=
IDirect3DDevice8_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
hr
=
IDirect3DDevice8_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
D3DERR_DEVICELOST
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3DERR_DEVICELOST
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
reset_device
(
device
,
window
,
FALSE
);
hr
=
reset_device
(
device
,
&
device_desc
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_TestCooperativeLevel
(
device
);
hr
=
IDirect3DDevice8_TestCooperativeLevel
(
device
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
hr
=
IDirect3DDevice8_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
reset_device
(
device
,
window
,
TRUE
);
device_desc
.
flags
=
0
;
hr
=
reset_device
(
device
,
&
device_desc
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_TestCooperativeLevel
(
device
);
hr
=
IDirect3DDevice8_TestCooperativeLevel
(
device
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
...
@@ -6534,7 +6551,8 @@ static void test_lost_device(void)
...
@@ -6534,7 +6551,8 @@ static void test_lost_device(void)
hr
=
IDirect3DDevice8_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
hr
=
IDirect3DDevice8_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
reset_device
(
device
,
window
,
FALSE
);
device_desc
.
flags
=
CREATE_DEVICE_FULLSCREEN
;
hr
=
reset_device
(
device
,
&
device_desc
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
D3D_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_TestCooperativeLevel
(
device
);
hr
=
IDirect3DDevice8_TestCooperativeLevel
(
device
);
todo_wine
ok
(
hr
==
D3DERR_DEVICELOST
,
"Got unexpected hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
hr
==
D3DERR_DEVICELOST
,
"Got unexpected hr %#x.
\n
"
,
hr
);
...
...
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