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
8fa82bd1
Commit
8fa82bd1
authored
Nov 08, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 09, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Test that GetDC() records a dirty rect.
parent
ee209a93
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
visual.c
dlls/d3d9/tests/visual.c
+28
-0
No files found.
dlls/d3d9/tests/visual.c
View file @
8fa82bd1
...
@@ -19507,6 +19507,7 @@ static void add_dirty_rect_test(void)
...
@@ -19507,6 +19507,7 @@ static void add_dirty_rect_test(void)
ULONG
refcount
;
ULONG
refcount
;
DWORD
*
texel
;
DWORD
*
texel
;
HWND
window
;
HWND
window
;
HDC
dc
;
D3DLOCKED_RECT
locked_rect
;
D3DLOCKED_RECT
locked_rect
;
static
const
RECT
part_rect
=
{
96
,
96
,
160
,
160
};
static
const
RECT
part_rect
=
{
96
,
96
,
160
,
160
};
static
const
RECT
oob_rect
[]
=
static
const
RECT
oob_rect
[]
=
...
@@ -19748,6 +19749,21 @@ static void add_dirty_rect_test(void)
...
@@ -19748,6 +19749,21 @@ static void add_dirty_rect_test(void)
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to present, hr %#lx.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to present, hr %#lx.
\n
"
,
hr
);
/* GetDC() records a dirty rect. */
fill_surface
(
surface_src_green
,
0x00000080
,
D3DLOCK_NO_DIRTY_UPDATE
);
hr
=
IDirect3DSurface9_GetDC
(
surface_src_green
,
&
dc
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DSurface9_ReleaseDC
(
surface_src_green
,
dc
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_UpdateTexture
(
device
,
(
IDirect3DBaseTexture9
*
)
tex_src_green
,
(
IDirect3DBaseTexture9
*
)
tex_dst2
);
ok
(
SUCCEEDED
(
hr
),
"Failed to update texture, hr %#lx.
\n
"
,
hr
);
add_dirty_rect_test_draw
(
device
);
color
=
getPixelColor
(
device
,
320
,
240
);
todo_wine
ok
(
color_match
(
color
,
0x00000080
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to present, hr %#lx.
\n
"
,
hr
);
fill_surface
(
surface_src_red
,
0x00ff0000
,
0
);
fill_surface
(
surface_src_red
,
0x00ff0000
,
0
);
fill_surface
(
surface_src_green
,
0x0000ff00
,
0
);
fill_surface
(
surface_src_green
,
0x0000ff00
,
0
);
...
@@ -19873,6 +19889,18 @@ static void add_dirty_rect_test(void)
...
@@ -19873,6 +19889,18 @@ static void add_dirty_rect_test(void)
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to present, hr %#lx.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to present, hr %#lx.
\n
"
,
hr
);
/* So does GetDC(). */
fill_surface
(
surface_managed0
,
0x00000080
,
D3DLOCK_NO_DIRTY_UPDATE
);
hr
=
IDirect3DSurface9_GetDC
(
surface_managed0
,
&
dc
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DSurface9_ReleaseDC
(
surface_managed0
,
dc
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
add_dirty_rect_test_draw
(
device
);
color
=
getPixelColor
(
device
,
320
,
240
);
todo_wine
ok
(
color_match
(
color
,
0x00000080
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to present, hr %#lx.
\n
"
,
hr
);
/* Tests with dynamic textures */
/* Tests with dynamic textures */
fill_surface
(
surface_dynamic
,
0x0000ffff
,
0
);
fill_surface
(
surface_dynamic
,
0x0000ffff
,
0
);
hr
=
IDirect3DDevice9_SetTexture
(
device
,
0
,
(
IDirect3DBaseTexture9
*
)
tex_dynamic
);
hr
=
IDirect3DDevice9_SetTexture
(
device
,
0
,
(
IDirect3DBaseTexture9
*
)
tex_dynamic
);
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