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
f64815e6
Commit
f64815e6
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: Port D3D1_ViewportClearTest to ddraw1.c (v2).
parent
e37272ee
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
132 additions
and
0 deletions
+132
-0
ddraw1.c
dlls/ddraw/tests/ddraw1.c
+66
-0
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+66
-0
visual.c
dlls/ddraw/tests/visual.c
+0
-0
No files found.
dlls/ddraw/tests/ddraw1.c
View file @
f64815e6
...
...
@@ -6303,6 +6303,71 @@ static void test_texturemapblend(void)
DestroyWindow
(
window
);
}
static
void
test_viewport_clear_rect
(
void
)
{
HRESULT
hr
;
static
D3DRECT
clear_rect
=
{{
0
},
{
0
},
{
640
},
{
480
}};
static
D3DRECT
clear_rect2
=
{{
90
},
{
90
},
{
110
},
{
110
}};
IDirectDrawSurface
*
rt
;
HWND
window
;
IDirectDraw
*
ddraw
;
IDirect3DDevice
*
device
;
IDirect3DMaterial
*
red
,
*
green
;
IDirect3DViewport
*
viewport
,
*
viewport2
;
ULONG
ref
;
D3DCOLOR
color
;
window
=
CreateWindowA
(
"static"
,
"ddraw_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
if
(
!
(
device
=
create_device
(
ddraw
,
window
,
DDSCL_NORMAL
)))
{
skip
(
"Failed to create a 3D device, skipping test.
\n
"
);
DestroyWindow
(
window
);
IDirectDraw_Release
(
ddraw
);
return
;
}
hr
=
IDirect3DDevice_QueryInterface
(
device
,
&
IID_IDirectDrawSurface
,
(
void
**
)
&
rt
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get render target, hr %#x.
\n
"
,
hr
);
red
=
create_diffuse_material
(
device
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
);
viewport
=
create_viewport
(
device
,
0
,
0
,
640
,
480
);
viewport_set_background
(
device
,
viewport
,
red
);
hr
=
IDirect3DViewport_Clear
(
viewport
,
1
,
&
clear_rect
,
D3DCLEAR_TARGET
);
ok
(
SUCCEEDED
(
hr
),
"Failed to clear viewport, hr %#x.
\n
"
,
hr
);
green
=
create_diffuse_material
(
device
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
1
.
0
f
);
viewport2
=
create_viewport
(
device
,
100
,
100
,
20
,
20
);
viewport_set_background
(
device
,
viewport2
,
green
);
hr
=
IDirect3DViewport_Clear
(
viewport2
,
1
,
&
clear_rect2
,
D3DCLEAR_TARGET
);
ok
(
SUCCEEDED
(
hr
),
"Failed to clear viewport, hr %#x.
\n
"
,
hr
);
color
=
get_surface_color
(
rt
,
85
,
85
);
/* Outside both. */
ok
(
compare_color
(
color
,
0x00ff0000
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
rt
,
95
,
95
);
/* Outside vp, inside rect. */
/* AMD GPUs ignore the viewport dimensions and only care about the rectangle. */
ok
(
compare_color
(
color
,
0x00ff0000
,
1
)
||
broken
(
compare_color
(
color
,
0x0000ff00
,
1
)),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
rt
,
105
,
105
);
/* Inside both. */
ok
(
compare_color
(
color
,
0x0000ff00
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
rt
,
115
,
115
);
/* Inside vp, outside rect. */
ok
(
compare_color
(
color
,
0x00ff0000
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
rt
,
125
,
125
);
/* Outside both. */
ok
(
compare_color
(
color
,
0x00ff0000
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
destroy_viewport
(
device
,
viewport2
);
destroy_material
(
green
);
destroy_viewport
(
device
,
viewport
);
destroy_material
(
red
);
IDirectDrawSurface_Release
(
rt
);
IDirect3DDevice_Release
(
device
);
ref
=
IDirectDraw_Release
(
ddraw
);
ok
(
ref
==
0
,
"Ddraw object not properly released, refcount %u.
\n
"
,
ref
);
DestroyWindow
(
window
);
}
START_TEST
(
ddraw1
)
{
IDirectDraw
*
ddraw
;
...
...
@@ -6369,4 +6434,5 @@ START_TEST(ddraw1)
test_lost_device
();
test_surface_desc_lock
();
test_texturemapblend
();
test_viewport_clear_rect
();
}
dlls/ddraw/tests/ddraw2.c
View file @
f64815e6
...
...
@@ -7329,6 +7329,71 @@ static void test_texturemapblend(void)
DestroyWindow
(
window
);
}
static
void
test_viewport_clear_rect
(
void
)
{
HRESULT
hr
;
static
D3DRECT
clear_rect
=
{{
0
},
{
0
},
{
640
},
{
480
}};
static
D3DRECT
clear_rect2
=
{{
90
},
{
90
},
{
110
},
{
110
}};
IDirectDrawSurface
*
rt
;
HWND
window
;
IDirectDraw2
*
ddraw
;
IDirect3DDevice2
*
device
;
IDirect3DMaterial2
*
red
,
*
green
;
IDirect3DViewport2
*
viewport
,
*
viewport2
;
ULONG
ref
;
D3DCOLOR
color
;
window
=
CreateWindowA
(
"static"
,
"ddraw_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
if
(
!
(
device
=
create_device
(
ddraw
,
window
,
DDSCL_NORMAL
)))
{
skip
(
"Failed to create a 3D device, skipping test.
\n
"
);
DestroyWindow
(
window
);
IDirectDraw2_Release
(
ddraw
);
return
;
}
hr
=
IDirect3DDevice2_GetRenderTarget
(
device
,
&
rt
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get render target, hr %#x.
\n
"
,
hr
);
red
=
create_diffuse_material
(
device
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
);
viewport
=
create_viewport
(
device
,
0
,
0
,
640
,
480
);
viewport_set_background
(
device
,
viewport
,
red
);
hr
=
IDirect3DViewport2_Clear
(
viewport
,
1
,
&
clear_rect
,
D3DCLEAR_TARGET
);
ok
(
SUCCEEDED
(
hr
),
"Failed to clear viewport, hr %#x.
\n
"
,
hr
);
green
=
create_diffuse_material
(
device
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
1
.
0
f
);
viewport2
=
create_viewport
(
device
,
100
,
100
,
20
,
20
);
viewport_set_background
(
device
,
viewport2
,
green
);
hr
=
IDirect3DViewport2_Clear
(
viewport2
,
1
,
&
clear_rect2
,
D3DCLEAR_TARGET
);
ok
(
SUCCEEDED
(
hr
),
"Failed to clear viewport, hr %#x.
\n
"
,
hr
);
color
=
get_surface_color
(
rt
,
85
,
85
);
/* Outside both. */
ok
(
compare_color
(
color
,
0x00ff0000
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
rt
,
95
,
95
);
/* Outside vp, inside rect. */
/* AMD GPUs ignore the viewport dimensions and only care about the rectangle. */
ok
(
compare_color
(
color
,
0x00ff0000
,
1
)
||
broken
(
compare_color
(
color
,
0x0000ff00
,
1
)),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
rt
,
105
,
105
);
/* Inside both. */
ok
(
compare_color
(
color
,
0x0000ff00
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
rt
,
115
,
115
);
/* Inside vp, outside rect. */
ok
(
compare_color
(
color
,
0x00ff0000
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
rt
,
125
,
125
);
/* Outside both. */
ok
(
compare_color
(
color
,
0x00ff0000
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
destroy_viewport
(
device
,
viewport2
);
destroy_material
(
green
);
destroy_viewport
(
device
,
viewport
);
destroy_material
(
red
);
IDirectDrawSurface_Release
(
rt
);
IDirect3DDevice2_Release
(
device
);
ref
=
IDirectDraw2_Release
(
ddraw
);
ok
(
ref
==
0
,
"Ddraw object not properly released, refcount %u.
\n
"
,
ref
);
DestroyWindow
(
window
);
}
START_TEST
(
ddraw2
)
{
IDirectDraw2
*
ddraw
;
...
...
@@ -7401,4 +7466,5 @@ START_TEST(ddraw2)
test_lost_device
();
test_surface_desc_lock
();
test_texturemapblend
();
test_viewport_clear_rect
();
}
dlls/ddraw/tests/visual.c
View file @
f64815e6
This diff is collapsed.
Click to expand it.
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