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
1cb9a31b
Commit
1cb9a31b
authored
Mar 30, 2020
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1/tests: Introduce compare_uint().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c635f955
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
d2d1.c
dlls/d2d1/tests/d2d1.c
+11
-12
No files found.
dlls/d2d1/tests/d2d1.c
View file @
1cb9a31b
...
...
@@ -346,20 +346,19 @@ static DWORD get_readback_colour(struct resource_readback *rb, unsigned int x, u
return
((
DWORD
*
)((
BYTE
*
)
rb
->
map_desc
.
pData
+
y
*
rb
->
map_desc
.
RowPitch
))[
x
];
}
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
compare_colour
(
DWORD
c1
,
DWORD
c2
,
BYTE
max_diff
)
{
if
(
abs
((
c1
&
0xff
)
-
(
c2
&
0xff
))
>
max_diff
)
return
FALSE
;
c1
>>=
8
;
c2
>>=
8
;
if
(
abs
((
c1
&
0xff
)
-
(
c2
&
0xff
))
>
max_diff
)
return
FALSE
;
c1
>>=
8
;
c2
>>=
8
;
if
(
abs
((
c1
&
0xff
)
-
(
c2
&
0xff
))
>
max_diff
)
return
FALSE
;
c1
>>=
8
;
c2
>>=
8
;
if
(
abs
((
c1
&
0xff
)
-
(
c2
&
0xff
))
>
max_diff
)
return
FALSE
;
return
TRUE
;
return
compare_uint
(
c1
&
0xff
,
c2
&
0xff
,
max_diff
)
&&
compare_uint
((
c1
>>
8
)
&
0xff
,
(
c2
>>
8
)
&
0xff
,
max_diff
)
&&
compare_uint
((
c1
>>
16
)
&
0xff
,
(
c2
>>
16
)
&
0xff
,
max_diff
)
&&
compare_uint
((
c1
>>
24
)
&
0xff
,
(
c2
>>
24
)
&
0xff
,
max_diff
);
}
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