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
e8c2e505
Commit
e8c2e505
authored
Mar 06, 2020
by
Ziqing Hui
Committed by
Alexandre Julliard
Mar 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Add tests for grayscale.
Signed-off-by:
Ziqing Hui
<
zhui@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d6268b9e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
2 deletions
+40
-2
imagelist.c
dlls/comctl32/tests/imagelist.c
+40
-2
No files found.
dlls/comctl32/tests/imagelist.c
View file @
e8c2e505
...
...
@@ -1444,6 +1444,43 @@ static void check_ImageList_DrawIndirect_broken(HDC hdc, HIMAGELIST himl, UINT32
bits
[
0
]
&
0x00FFFFFF
,
expected
,
line
);
}
static
void
check_ImageList_DrawIndirect_grayscale
(
HDC
hdc
,
HIMAGELIST
himl
,
UINT32
*
dst_bits
,
const
UINT32
*
bitmap_bits
,
int
index
,
UINT
width
,
UINT
height
,
int
line
)
{
int
i
;
BOOL
has_alpha
=
FALSE
;
IMAGELISTDRAWPARAMS
ildp
=
{
sizeof
(
IMAGELISTDRAWPARAMS
),
himl
,
index
,
hdc
,
0
,
0
,
0
,
0
,
0
,
0
,
CLR_NONE
,
CLR_NONE
,
ILD_NORMAL
,
0
,
ILS_SATURATE
,
0
,
0x00000000
};
memset
(
dst_bits
,
0
,
width
*
height
*
sizeof
(
*
dst_bits
));
pImageList_DrawIndirect
(
&
ildp
);
for
(
i
=
0
;
i
<
width
*
height
;
i
++
)
if
((
has_alpha
=
((
bitmap_bits
[
i
]
&
0xFF000000
)
!=
0
)))
break
;
for
(
i
=
0
;
i
<
width
*
height
;
i
++
)
{
UINT32
expected
,
expected_winxp
;
UINT32
red
=
(
bitmap_bits
[
i
]
&
0x00FF0000
)
>>
16
;
UINT32
green
=
(
bitmap_bits
[
i
]
&
0x0000FF00
)
>>
8
;
UINT32
blue
=
(
bitmap_bits
[
i
]
&
0x000000FF
)
>>
0
;
UINT32
gray
=
(
red
*
299
+
green
*
587
+
blue
*
114
+
500
)
/
1000
;
UINT32
gray_winxp
=
(
red
+
green
+
blue
)
/
3
;
if
(
has_alpha
)
{
UINT32
alpha
=
(
bitmap_bits
[
i
]
&
0xFF000000
)
>>
24
;
gray
=
gray
*
alpha
/
0xff
*
alpha
/
0xff
;
gray_winxp
=
gray_winxp
*
alpha
/
0xff
*
0x96
/
0xff
;
}
expected
=
(
gray
<<
16
)
|
(
gray
<<
8
)
|
gray
;
expected_winxp
=
(
gray_winxp
<<
16
)
|
(
gray_winxp
<<
8
)
|
gray_winxp
;
todo_wine_if
(
expected
!=
0
&&
expected
!=
0x00FFFFFF
)
ok
(
colour_match
(
dst_bits
[
i
],
expected
)
||
broken
(
colour_match
(
dst_bits
[
i
],
expected_winxp
)),
"ImageList_DrawIndirect: got Pixel(%d,%d) %08X, Expected a close match to %08X from line %d
\n
"
,
i
%
width
,
i
/
width
,
dst_bits
[
i
]
&
0x00FFFFFF
,
expected
,
line
);
}
}
static
void
test_ImageList_DrawIndirect
(
void
)
{
const
UINT32
bits_image
[]
=
{
0x00ABCDEF
,
0x00ABCDEF
};
...
...
@@ -1546,8 +1583,9 @@ static void test_ImageList_DrawIndirect(void)
check_ImageList_DrawIndirect_ILD_ROP
(
hdcDst
,
himl
,
bits
,
iAlphaImage
,
SRCCOPY
,
0x00D3E5F7
,
__LINE__
);
check_ImageList_DrawIndirect_ILD_ROP
(
hdcDst
,
himl
,
bits
,
iAlphaImage
,
SRCINVERT
,
0x00D3E5F7
,
__LINE__
);
todo_wine
check_ImageList_DrawIndirect_fState
(
hdcDst
,
himl
,
bits
,
iImage
,
ILD_NORMAL
,
ILS_SATURATE
,
0
,
0x00CCCCCC
,
__LINE__
);
todo_wine
check_ImageList_DrawIndirect_broken
(
hdcDst
,
himl
,
bits
,
iAlphaImage
,
ILD_NORMAL
,
ILS_SATURATE
,
0
,
0x00AFAFAF
,
0x00F0F0F0
,
__LINE__
);
check_ImageList_DrawIndirect_grayscale
(
hdcDst
,
himl
,
bits
,
bits_image
,
iImage
,
2
,
1
,
__LINE__
);
check_ImageList_DrawIndirect_grayscale
(
hdcDst
,
himl
,
bits
,
bits_alpha
,
iAlphaImage
,
2
,
1
,
__LINE__
);
check_ImageList_DrawIndirect_grayscale
(
hdcDst
,
himl
,
bits
,
bits_transparent
,
iTransparentImage
,
2
,
1
,
__LINE__
);
check_ImageList_DrawIndirect_fState
(
hdcDst
,
himl
,
bits
,
iImage
,
ILD_NORMAL
,
ILS_GLOW
,
0
,
0x00ABCDEF
,
__LINE__
);
check_ImageList_DrawIndirect_fState
(
hdcDst
,
himl
,
bits
,
iImage
,
ILD_NORMAL
,
ILS_SHADOW
,
0
,
0x00ABCDEF
,
__LINE__
);
...
...
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