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
29680b68
Commit
29680b68
authored
Apr 15, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Use a separate device for add_dirty_rect_test().
parent
ef5e4c79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
14 deletions
+31
-14
visual.c
dlls/d3d8/tests/visual.c
+31
-14
No files found.
dlls/d3d8/tests/visual.c
View file @
29680b68
...
...
@@ -4333,10 +4333,10 @@ static void add_dirty_rect_test_draw(IDirect3DDevice8 *device)
}
quad
[]
=
{
{{
-
1
.
0
,
-
1
.
0
,
0
.
0
},
{
0
.
0
,
0
.
0
}},
{{
1
.
0
,
-
1
.
0
,
0
.
0
},
{
1
.
0
,
0
.
0
}},
{{
-
1
.
0
,
1
.
0
,
0
.
0
},
{
0
.
0
,
1
.
0
}},
{{
1
.
0
,
1
.
0
,
0
.
0
},
{
1
.
0
,
1
.
0
}},
{{
-
1
.
0
f
,
-
1
.
0
f
,
0
.
0
f
},
{
0
.
0
f
,
0
.
0
f
}},
{{
-
1
.
0
f
,
1
.
0
f
,
0
.
0
f
},
{
0
.
0
f
,
1
.
0
f
}},
{{
1
.
0
f
,
-
1
.
0
f
,
0
.
0
f
},
{
1
.
0
f
,
0
.
0
f
}},
{{
1
.
0
f
,
1
.
0
f
,
0
.
0
f
},
{
1
.
0
f
,
1
.
0
f
}},
};
hr
=
IDirect3DDevice8_BeginScene
(
device
);
...
...
@@ -4347,16 +4347,31 @@ static void add_dirty_rect_test_draw(IDirect3DDevice8 *device)
ok
(
SUCCEEDED
(
hr
),
"Failed to end scene, hr %#x.
\n
"
,
hr
);
}
static
void
add_dirty_rect_test
(
IDirect3DDevice8
*
device
)
static
void
add_dirty_rect_test
(
void
)
{
HRESULT
hr
;
IDirect3DTexture8
*
tex_dst1
,
*
tex_dst2
,
*
tex_src_red
,
*
tex_src_green
,
*
tex_managed
;
IDirect3DSurface8
*
surface_dst2
,
*
surface_src_green
,
*
surface_src_red
,
*
surface_managed
;
IDirect3DTexture8
*
tex_dst1
,
*
tex_dst2
,
*
tex_src_red
,
*
tex_src_green
,
*
tex_managed
;
D3DLOCKED_RECT
locked_rect
;
IDirect3DDevice8
*
device
;
IDirect3D8
*
d3d
;
unsigned
int
i
;
D3DCOLOR
color
;
ULONG
refcount
;
DWORD
*
texel
;
D3DLOCKED_RECT
locked_rect
;
HWND
window
;
HRESULT
hr
;
static
const
RECT
part_rect
=
{
96
,
96
,
160
,
160
};
DWORD
color
;
window
=
CreateWindowA
(
"static"
,
"d3d8_test"
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
0
,
0
,
640
,
480
,
NULL
,
NULL
,
NULL
,
NULL
);
d3d
=
Direct3DCreate8
(
D3D_SDK_VERSION
);
ok
(
!!
d3d
,
"Failed to create a D3D object.
\n
"
);
if
(
!
(
device
=
create_device
(
d3d
,
window
,
window
,
TRUE
)))
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
goto
done
;
}
hr
=
IDirect3DDevice8_CreateTexture
(
device
,
256
,
256
,
1
,
0
,
D3DFMT_X8R8G8B8
,
D3DPOOL_DEFAULT
,
&
tex_dst1
);
...
...
@@ -4632,10 +4647,6 @@ static void add_dirty_rect_test(IDirect3DDevice8 *device)
hr
=
IDirect3DTexture8_AddDirtyRect
(
tex_managed
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to add dirty rect, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetTextureStageState
(
device
,
0
,
D3DTSS_COLOROP
,
D3DTOP_DISABLE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set color op, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetTexture
(
device
,
0
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set texture, hr %#x.
\n
"
,
hr
);
IDirect3DSurface8_Release
(
surface_dst2
);
IDirect3DSurface8_Release
(
surface_managed
);
IDirect3DSurface8_Release
(
surface_src_red
);
...
...
@@ -4645,6 +4656,11 @@ static void add_dirty_rect_test(IDirect3DDevice8 *device)
IDirect3DTexture8_Release
(
tex_dst1
);
IDirect3DTexture8_Release
(
tex_dst2
);
IDirect3DTexture8_Release
(
tex_managed
);
refcount
=
IDirect3DDevice8_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
done:
IDirect3D8_Release
(
d3d
);
DestroyWindow
(
window
);
}
START_TEST
(
visual
)
...
...
@@ -4721,11 +4737,12 @@ START_TEST(visual)
fog_special_test
(
device_ptr
);
volume_dxt5_test
(
device_ptr
);
volume_v16u16_test
(
device_ptr
);
add_dirty_rect_test
(
device_ptr
);
refcount
=
IDirect3DDevice8_Release
(
device_ptr
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
cleanup
:
IDirect3D8_Release
(
d3d
);
DestroyWindow
(
window
);
add_dirty_rect_test
();
}
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