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
5408c5ea
Commit
5408c5ea
authored
Feb 16, 2015
by
Stefan Dösinger
Committed by
Alexandre Julliard
Feb 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Create a device in test_surface_discard.
parent
f64815e6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
20 deletions
+28
-20
ddraw1.c
dlls/ddraw/tests/ddraw1.c
+14
-10
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+14
-10
No files found.
dlls/ddraw/tests/ddraw1.c
View file @
5408c5ea
...
...
@@ -3951,10 +3951,11 @@ static void test_surface_lock(void)
static
void
test_surface_discard
(
void
)
{
IDirectDraw
*
ddraw
;
IDirect3DDevice
*
device
;
HRESULT
hr
;
HWND
window
;
DDSURFACEDESC
ddsd
;
IDirectDrawSurface
*
surface
,
*
primary
;
IDirectDrawSurface
*
surface
,
*
target
;
void
*
addr
;
static
const
struct
{
...
...
@@ -3974,14 +3975,16 @@ static void test_surface_discard(void)
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
hr
=
IDirectDraw_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_NORMAL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set cooperative level, hr %#x.
\n
"
,
hr
);
if
(
!
(
device
=
create_device
(
ddraw
,
window
,
DDSCL_NORMAL
)))
{
skip
(
"Failed to create a 3D device, skipping test.
\n
"
);
IDirectDraw_Release
(
ddraw
);
DestroyWindow
(
window
);
return
;
}
memset
(
&
ddsd
,
0
,
sizeof
(
ddsd
));
ddsd
.
dwSize
=
sizeof
(
ddsd
);
ddsd
.
dwFlags
=
DDSD_CAPS
;
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_PRIMARYSURFACE
;
hr
=
IDirectDraw_CreateSurface
(
ddraw
,
&
ddsd
,
&
primary
,
NULL
);
hr
=
IDirect3DDevice_QueryInterface
(
device
,
&
IID_IDirectDrawSurface
,
(
void
**
)
&
target
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get render target, hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
sizeof
(
tests
)
/
sizeof
(
*
tests
);
i
++
)
{
...
...
@@ -4016,7 +4019,7 @@ static void test_surface_discard(void)
hr
=
IDirectDrawSurface_Unlock
(
surface
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to unlock surface, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface_Blt
(
primary
,
NULL
,
surface
,
NULL
,
DDBLT_WAIT
,
NULL
);
hr
=
IDirectDrawSurface_Blt
(
target
,
NULL
,
surface
,
NULL
,
DDBLT_WAIT
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to blit, hr %#x.
\n
"
,
hr
);
memset
(
&
ddsd
,
0
,
sizeof
(
ddsd
));
...
...
@@ -4034,7 +4037,8 @@ static void test_surface_discard(void)
ok
(
!
discarded
||
tests
[
i
].
discard
,
"Expected surface not to be discarded, case %u
\n
"
,
i
);
}
IDirectDrawSurface_Release
(
primary
);
IDirectDrawSurface_Release
(
target
);
IDirect3DDevice_Release
(
device
);
IDirectDraw_Release
(
ddraw
);
DestroyWindow
(
window
);
}
...
...
dlls/ddraw/tests/ddraw2.c
View file @
5408c5ea
...
...
@@ -4622,10 +4622,11 @@ static void test_surface_lock(void)
static
void
test_surface_discard
(
void
)
{
IDirectDraw2
*
ddraw
;
IDirect3DDevice2
*
device
;
HRESULT
hr
;
HWND
window
;
DDSURFACEDESC
ddsd
;
IDirectDrawSurface
*
surface
,
*
primary
;
IDirectDrawSurface
*
surface
,
*
target
;
void
*
addr
;
static
const
struct
{
...
...
@@ -4645,14 +4646,16 @@ static void test_surface_discard(void)
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
hr
=
IDirectDraw2_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_NORMAL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set cooperative level, hr %#x.
\n
"
,
hr
);
if
(
!
(
device
=
create_device
(
ddraw
,
window
,
DDSCL_NORMAL
)))
{
skip
(
"Failed to create a 3D device, skipping test.
\n
"
);
DestroyWindow
(
window
);
IDirectDraw2_Release
(
ddraw
);
return
;
}
memset
(
&
ddsd
,
0
,
sizeof
(
ddsd
));
ddsd
.
dwSize
=
sizeof
(
ddsd
);
ddsd
.
dwFlags
=
DDSD_CAPS
;
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_PRIMARYSURFACE
;
hr
=
IDirectDraw2_CreateSurface
(
ddraw
,
&
ddsd
,
&
primary
,
NULL
);
hr
=
IDirect3DDevice2_GetRenderTarget
(
device
,
&
target
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get render target, hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
sizeof
(
tests
)
/
sizeof
(
*
tests
);
i
++
)
{
...
...
@@ -4687,7 +4690,7 @@ static void test_surface_discard(void)
hr
=
IDirectDrawSurface_Unlock
(
surface
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to unlock surface, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface_Blt
(
primary
,
NULL
,
surface
,
NULL
,
DDBLT_WAIT
,
NULL
);
hr
=
IDirectDrawSurface_Blt
(
target
,
NULL
,
surface
,
NULL
,
DDBLT_WAIT
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to blit, hr %#x.
\n
"
,
hr
);
memset
(
&
ddsd
,
0
,
sizeof
(
ddsd
));
...
...
@@ -4705,7 +4708,8 @@ static void test_surface_discard(void)
ok
(
!
discarded
||
tests
[
i
].
discard
,
"Expected surface not to be discarded, case %u
\n
"
,
i
);
}
IDirectDrawSurface_Release
(
primary
);
IDirectDrawSurface_Release
(
target
);
IDirect3DDevice2_Release
(
device
);
IDirectDraw2_Release
(
ddraw
);
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