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
d818e4ed
Commit
d818e4ed
authored
Oct 05, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 05, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Always pass "struct event_data" to "event_fn" in the stateblock tests.
parent
54e28991
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
35 deletions
+28
-35
stateblock.c
dlls/d3d8/tests/stateblock.c
+28
-35
No files found.
dlls/d3d8/tests/stateblock.c
View file @
d818e4ed
...
...
@@ -154,9 +154,16 @@ struct state_test
#define EVENT_ERROR 0x08
#define EVENT_APPLY_DATA 0x10
struct
event_data
{
DWORD
stateblock
;
IDirect3DSurface8
*
original_render_target
;
IDirect3DSwapChain8
*
new_swap_chain
;
};
struct
event
{
int
(
*
event_fn
)(
IDirect3DDevice8
*
device
,
void
*
arg
);
int
(
*
event_fn
)(
IDirect3DDevice8
*
device
,
struct
event_data
*
event_data
);
int
status
;
};
...
...
@@ -164,7 +171,7 @@ struct event
* It tests get and set operations for a batch of states, based on
* results from the event function, which directs what's to be done */
static
void
execute_test_chain
(
IDirect3DDevice8
*
device
,
struct
state_test
*
test
,
unsigned
int
ntests
,
struct
event
*
event
,
unsigned
int
nevents
,
void
*
event_arg
)
unsigned
int
ntests
,
struct
event
*
event
,
unsigned
int
nevents
,
struct
event_data
*
event_data
)
{
unsigned
int
i
=
0
,
j
;
int
outcome
;
...
...
@@ -174,7 +181,7 @@ static void execute_test_chain(IDirect3DDevice8 *device, struct state_test *test
{
/* Execute the next event handler (if available) or just set the supplied status */
outcome
=
event
[
j
].
status
;
if
(
event
[
j
].
event_fn
)
outcome
|=
event
[
j
].
event_fn
(
device
,
event_
arg
);
if
(
event
[
j
].
event_fn
)
outcome
|=
event
[
j
].
event_fn
(
device
,
event_
data
);
/* Now verify correct outcome depending on what was signaled by the handler.
* An EVENT_CHECK_TEST signal means check the returned data against the test_data (out).
...
...
@@ -256,19 +263,11 @@ static void execute_test_chain(IDirect3DDevice8 *device, struct state_test *test
}
}
struct
event_data
{
DWORD
stateblock
;
IDirect3DSurface8
*
original_render_target
;
IDirect3DSwapChain8
*
new_swap_chain
;
};
static
int
switch_render_target
(
IDirect3DDevice8
*
device
,
void
*
data
)
static
int
switch_render_target
(
IDirect3DDevice8
*
device
,
struct
event_data
*
event_data
)
{
D3DPRESENT_PARAMETERS
present_parameters
;
IDirect3DSwapChain8
*
swapchain
=
NULL
;
IDirect3DSurface8
*
backbuffer
=
NULL
;
struct
event_data
*
edata
=
data
;
D3DDISPLAYMODE
d3ddm
;
HRESULT
hr
;
...
...
@@ -290,7 +289,7 @@ static int switch_render_target(IDirect3DDevice8* device, void *data)
if
(
FAILED
(
hr
))
goto
error
;
/* Save the current render target */
hr
=
IDirect3DDevice8_GetRenderTarget
(
device
,
&
edata
->
original_render_target
);
hr
=
IDirect3DDevice8_GetRenderTarget
(
device
,
&
e
vent_
data
->
original_render_target
);
ok
(
SUCCEEDED
(
hr
),
"GetRenderTarget returned %#x.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
goto
error
;
...
...
@@ -300,7 +299,7 @@ static int switch_render_target(IDirect3DDevice8* device, void *data)
if
(
FAILED
(
hr
))
goto
error
;
IDirect3DSurface8_Release
(
backbuffer
);
edata
->
new_swap_chain
=
swapchain
;
e
vent_
data
->
new_swap_chain
=
swapchain
;
return
EVENT_OK
;
error:
...
...
@@ -309,26 +308,25 @@ error:
return
EVENT_ERROR
;
}
static
int
revert_render_target
(
IDirect3DDevice8
*
device
,
void
*
data
)
static
int
revert_render_target
(
IDirect3DDevice8
*
device
,
struct
event_data
*
event_
data
)
{
struct
event_data
*
edata
=
data
;
HRESULT
hr
;
/* Reset the old render target */
hr
=
IDirect3DDevice8_SetRenderTarget
(
device
,
edata
->
original_render_target
,
NULL
);
hr
=
IDirect3DDevice8_SetRenderTarget
(
device
,
e
vent_
data
->
original_render_target
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"SetRenderTarget returned %#x.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
IDirect3DSurface8_Release
(
edata
->
original_render_target
);
IDirect3DSurface8_Release
(
e
vent_
data
->
original_render_target
);
return
EVENT_ERROR
;
}
IDirect3DSurface8_Release
(
edata
->
original_render_target
);
IDirect3DSwapChain8_Release
(
edata
->
new_swap_chain
);
IDirect3DSurface8_Release
(
e
vent_
data
->
original_render_target
);
IDirect3DSwapChain8_Release
(
e
vent_
data
->
new_swap_chain
);
return
EVENT_OK
;
}
static
int
begin_stateblock
(
IDirect3DDevice8
*
device
,
void
*
data
)
static
int
begin_stateblock
(
IDirect3DDevice8
*
device
,
struct
event_data
*
event_
data
)
{
HRESULT
hr
;
...
...
@@ -338,44 +336,39 @@ static int begin_stateblock(IDirect3DDevice8 *device, void *data)
return
EVENT_OK
;
}
static
int
end_stateblock
(
IDirect3DDevice8
*
device
,
void
*
data
)
static
int
end_stateblock
(
IDirect3DDevice8
*
device
,
struct
event_data
*
event_
data
)
{
struct
event_data
*
edata
=
data
;
HRESULT
hr
;
hr
=
IDirect3DDevice8_EndStateBlock
(
device
,
&
edata
->
stateblock
);
hr
=
IDirect3DDevice8_EndStateBlock
(
device
,
&
e
vent_
data
->
stateblock
);
ok
(
SUCCEEDED
(
hr
),
"EndStateBlock returned %#x.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
EVENT_ERROR
;
return
EVENT_OK
;
}
static
int
abort_stateblock
(
IDirect3DDevice8
*
device
,
void
*
data
)
static
int
abort_stateblock
(
IDirect3DDevice8
*
device
,
struct
event_data
*
event_
data
)
{
struct
event_data
*
edata
=
data
;
IDirect3DDevice8_DeleteStateBlock
(
device
,
edata
->
stateblock
);
IDirect3DDevice8_DeleteStateBlock
(
device
,
event_data
->
stateblock
);
return
EVENT_OK
;
}
static
int
apply_stateblock
(
IDirect3DDevice8
*
device
,
void
*
data
)
static
int
apply_stateblock
(
IDirect3DDevice8
*
device
,
struct
event_data
*
event_
data
)
{
struct
event_data
*
edata
=
data
;
HRESULT
hr
;
hr
=
IDirect3DDevice8_ApplyStateBlock
(
device
,
edata
->
stateblock
);
hr
=
IDirect3DDevice8_ApplyStateBlock
(
device
,
e
vent_
data
->
stateblock
);
ok
(
SUCCEEDED
(
hr
),
"Apply returned %#x.
\n
"
,
hr
);
IDirect3DDevice8_DeleteStateBlock
(
device
,
edata
->
stateblock
);
IDirect3DDevice8_DeleteStateBlock
(
device
,
e
vent_
data
->
stateblock
);
if
(
FAILED
(
hr
))
return
EVENT_ERROR
;
return
EVENT_OK
;
}
static
int
capture_stateblock
(
IDirect3DDevice8
*
device
,
void
*
data
)
static
int
capture_stateblock
(
IDirect3DDevice8
*
device
,
struct
event_data
*
event_
data
)
{
struct
event_data
*
edata
=
data
;
HRESULT
hr
;
hr
=
IDirect3DDevice8_CaptureStateBlock
(
device
,
edata
->
stateblock
);
hr
=
IDirect3DDevice8_CaptureStateBlock
(
device
,
e
vent_
data
->
stateblock
);
ok
(
SUCCEEDED
(
hr
),
"Capture returned %#x.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
EVENT_ERROR
;
...
...
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