Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
67f43418
Commit
67f43418
authored
Apr 14, 2010
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Apr 14, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Add an initial ColorFill regression test.
parent
bf73d23d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
0 deletions
+66
-0
visual.c
dlls/d3d9/tests/visual.c
+66
-0
No files found.
dlls/d3d9/tests/visual.c
View file @
67f43418
...
...
@@ -638,6 +638,71 @@ static void clear_test(IDirect3DDevice9 *device)
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
}
static
void
color_fill_test
(
IDirect3DDevice9
*
device
)
{
HRESULT
hr
;
IDirect3DSurface9
*
backbuffer
=
NULL
;
IDirect3DSurface9
*
rt_surface
=
NULL
;
IDirect3DSurface9
*
offscreen_surface
=
NULL
;
DWORD
fill_color
,
color
;
/* Test ColorFill on a the backbuffer (should pass) */
hr
=
IDirect3DDevice9_GetBackBuffer
(
device
,
0
,
0
,
D3DBACKBUFFER_TYPE_MONO
,
&
backbuffer
);
ok
(
hr
==
D3D_OK
,
"Can't get back buffer, hr = %08x
\n
"
,
hr
);
if
(
backbuffer
)
{
fill_color
=
0x112233
;
hr
=
IDirect3DDevice9_ColorFill
(
device
,
backbuffer
,
NULL
,
fill_color
);
color
=
getPixelColor
(
device
,
0
,
0
);
ok
(
color
==
fill_color
,
"Expected color %08x, got %08x
\n
"
,
fill_color
,
color
);
IDirect3DSurface9_Release
(
backbuffer
);
}
/* Test ColorFill on a render target surface (should pass) */
hr
=
IDirect3DDevice9_CreateRenderTarget
(
device
,
32
,
32
,
D3DFMT_A8R8G8B8
,
D3DMULTISAMPLE_NONE
,
0
,
TRUE
,
&
rt_surface
,
NULL
);
ok
(
hr
==
D3D_OK
,
"Unable to create render target surface, hr = %08x
\n
"
,
hr
);
if
(
rt_surface
)
{
fill_color
=
0x445566
;
hr
=
IDirect3DDevice9_ColorFill
(
device
,
rt_surface
,
NULL
,
fill_color
);
color
=
getPixelColorFromSurface
(
rt_surface
,
0
,
0
);
ok
(
color
==
fill_color
,
"Expected color %08x, got %08x
\n
"
,
fill_color
,
color
);
IDirect3DSurface9_Release
(
rt_surface
);
}
/* Test ColorFill on a offscreen plain surface in D3DPOOL_DEFAULT (should pass) */
hr
=
IDirect3DDevice9_CreateOffscreenPlainSurface
(
device
,
32
,
32
,
D3DFMT_A8R8G8B8
,
D3DPOOL_DEFAULT
,
&
offscreen_surface
,
NULL
);
ok
(
hr
==
D3D_OK
,
"Unable to create offscreen plain surface, hr = %08x
\n
"
,
hr
);
if
(
offscreen_surface
)
{
fill_color
=
0x778899
;
hr
=
IDirect3DDevice9_ColorFill
(
device
,
offscreen_surface
,
NULL
,
fill_color
);
color
=
getPixelColorFromSurface
(
offscreen_surface
,
0
,
0
);
ok
(
color
==
fill_color
,
"Expected color %08x, got %08x
\n
"
,
fill_color
,
color
);
IDirect3DSurface9_Release
(
offscreen_surface
);
}
/* Try ColorFill on a offscreen surface in sysmem (should fail) */
offscreen_surface
=
NULL
;
hr
=
IDirect3DDevice9_CreateOffscreenPlainSurface
(
device
,
32
,
32
,
D3DFMT_A8R8G8B8
,
D3DPOOL_SYSTEMMEM
,
&
offscreen_surface
,
NULL
);
ok
(
hr
==
D3D_OK
,
"Unable to create offscreen plain surface, hr = %08x
\n
"
,
hr
);
if
(
offscreen_surface
)
{
hr
=
IDirect3DDevice9_ColorFill
(
device
,
offscreen_surface
,
NULL
,
0
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"ColorFill on offscreen sysmem surface failed with hr = %08x
\n
"
,
hr
);
IDirect3DSurface9_Release
(
offscreen_surface
);
}
}
typedef
struct
{
float
in
[
4
];
DWORD
out
;
...
...
@@ -11041,6 +11106,7 @@ START_TEST(visual)
stretchrect_test
(
device_ptr
);
lighting_test
(
device_ptr
);
clear_test
(
device_ptr
);
color_fill_test
(
device_ptr
);
fog_test
(
device_ptr
);
if
(
caps
.
TextureCaps
&
D3DPTEXTURECAPS_CUBEMAP
)
{
...
...
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