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
2e9ff8bc
Commit
2e9ff8bc
authored
Mar 30, 2020
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Introduce compare_uint().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
67af6800
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
18 deletions
+22
-18
d3d9ex.c
dlls/d3d9/tests/d3d9ex.c
+11
-10
visual.c
dlls/d3d9/tests/visual.c
+11
-8
No files found.
dlls/d3d9/tests/d3d9ex.c
View file @
2e9ff8bc
...
@@ -48,18 +48,19 @@ static BOOL adapter_is_warp(const D3DADAPTER_IDENTIFIER9 *identifier)
...
@@ -48,18 +48,19 @@ static BOOL adapter_is_warp(const D3DADAPTER_IDENTIFIER9 *identifier)
return
!
strcmp
(
identifier
->
Driver
,
"d3d10warp.dll"
);
return
!
strcmp
(
identifier
->
Driver
,
"d3d10warp.dll"
);
}
}
static
BOOL
co
lor_match
(
D3DCOLOR
c1
,
D3DCOLOR
c2
,
BYTE
max_diff
)
static
BOOL
co
mpare_uint
(
unsigned
int
x
,
unsigned
int
y
,
unsigned
int
max_diff
)
{
{
unsigned
int
i
;
unsigned
int
diff
=
x
>
y
?
x
-
y
:
y
-
x
;
for
(
i
=
0
;
i
<
4
;
++
i
)
return
diff
<=
max_diff
;
{
}
if
(
abs
((
c1
&
0xff
)
-
(
c2
&
0xff
))
>
max_diff
)
return
FALSE
;
static
BOOL
color_match
(
D3DCOLOR
c1
,
D3DCOLOR
c2
,
BYTE
max_diff
)
c1
>>=
8
;
{
c2
>>=
8
;
return
compare_uint
(
c1
&
0xff
,
c2
&
0xff
,
max_diff
)
}
&&
compare_uint
((
c1
>>
8
)
&
0xff
,
(
c2
>>
8
)
&
0xff
,
max_diff
)
return
TRUE
;
&&
compare_uint
((
c1
>>
16
)
&
0xff
,
(
c2
>>
16
)
&
0xff
,
max_diff
)
&&
compare_uint
((
c1
>>
24
)
&
0xff
,
(
c2
>>
24
)
&
0xff
,
max_diff
);
}
}
static
DWORD
get_pixel_color
(
IDirect3DDevice9Ex
*
device
,
unsigned
int
x
,
unsigned
int
y
)
static
DWORD
get_pixel_color
(
IDirect3DDevice9Ex
*
device
,
unsigned
int
x
,
unsigned
int
y
)
...
...
dlls/d3d9/tests/visual.c
View file @
2e9ff8bc
...
@@ -63,16 +63,19 @@ static HWND create_window(void)
...
@@ -63,16 +63,19 @@ static HWND create_window(void)
return
hwnd
;
return
hwnd
;
}
}
static
BOOL
compare_uint
(
unsigned
int
x
,
unsigned
int
y
,
unsigned
int
max_diff
)
{
unsigned
int
diff
=
x
>
y
?
x
-
y
:
y
-
x
;
return
diff
<=
max_diff
;
}
static
BOOL
color_match
(
D3DCOLOR
c1
,
D3DCOLOR
c2
,
BYTE
max_diff
)
static
BOOL
color_match
(
D3DCOLOR
c1
,
D3DCOLOR
c2
,
BYTE
max_diff
)
{
{
if
(
abs
((
int
)(
c1
&
0xff
)
-
(
int
)(
c2
&
0xff
))
>
max_diff
)
return
FALSE
;
return
compare_uint
(
c1
&
0xff
,
c2
&
0xff
,
max_diff
)
c1
>>=
8
;
c2
>>=
8
;
&&
compare_uint
((
c1
>>
8
)
&
0xff
,
(
c2
>>
8
)
&
0xff
,
max_diff
)
if
(
abs
((
int
)(
c1
&
0xff
)
-
(
int
)(
c2
&
0xff
))
>
max_diff
)
return
FALSE
;
&&
compare_uint
((
c1
>>
16
)
&
0xff
,
(
c2
>>
16
)
&
0xff
,
max_diff
)
c1
>>=
8
;
c2
>>=
8
;
&&
compare_uint
((
c1
>>
24
)
&
0xff
,
(
c2
>>
24
)
&
0xff
,
max_diff
);
if
(
abs
((
int
)(
c1
&
0xff
)
-
(
int
)(
c2
&
0xff
))
>
max_diff
)
return
FALSE
;
c1
>>=
8
;
c2
>>=
8
;
if
(
abs
((
int
)(
c1
&
0xff
)
-
(
int
)(
c2
&
0xff
))
>
max_diff
)
return
FALSE
;
return
TRUE
;
}
}
static
BOOL
compare_float
(
float
f
,
float
g
,
unsigned
int
ulps
)
static
BOOL
compare_float
(
float
f
,
float
g
,
unsigned
int
ulps
)
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