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
d6305e1b
Commit
d6305e1b
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/imagelist: Support flag ILS_SATURATE for ImageList_DrawIndirect().
Signed-off-by:
Ziqing Hui
<
zhui@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7a172700
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
imagelist.c
dlls/comctl32/imagelist.c
+18
-6
imagelist.c
dlls/comctl32/tests/imagelist.c
+0
-1
No files found.
dlls/comctl32/imagelist.c
View file @
d6305e1b
...
...
@@ -1242,7 +1242,7 @@ ImageList_DrawEx (HIMAGELIST himl, INT i, HDC hdc, INT x, INT y,
static
BOOL
alpha_blend_image
(
HIMAGELIST
himl
,
HDC
dest_dc
,
int
dest_x
,
int
dest_y
,
int
src_x
,
int
src_y
,
int
cx
,
int
cy
,
BLENDFUNCTION
func
,
UINT
style
,
COLORREF
blend_col
,
BOOL
has_alpha
)
UINT
style
,
COLORREF
blend_col
,
BOOL
has_alpha
,
BOOL
grayscale
)
{
BOOL
ret
=
FALSE
;
HDC
hdc
;
...
...
@@ -1293,6 +1293,18 @@ static BOOL alpha_blend_image( HIMAGELIST himl, HDC dest_dc, int dest_x, int des
}
}
if
(
grayscale
)
{
for
(
i
=
0
,
ptr
=
bits
;
i
<
cx
*
cy
;
i
++
,
ptr
++
)
{
DWORD
gray
=
(((
*
ptr
&
0x00ff0000
)
>>
16
)
*
299
+
((
*
ptr
&
0x0000ff00
)
>>
8
)
*
587
+
((
*
ptr
&
0x000000ff
)
>>
0
)
*
114
+
500
)
/
1000
;
if
(
has_alpha
)
gray
=
gray
*
(
*
ptr
>>
24
)
/
255
;
*
ptr
=
(
*
ptr
&
0xff000000
)
|
(
gray
<<
16
)
|
(
gray
<<
8
)
|
gray
;
}
}
if
(
has_alpha
)
/* we already have an alpha channel in this case */
{
/* pre-multiply by the alpha channel */
...
...
@@ -1422,7 +1434,7 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
oldImageBk
=
SetBkColor
(
hImageDC
,
RGB
(
0xff
,
0xff
,
0xff
)
);
has_alpha
=
(
himl
->
has_alpha
&&
himl
->
has_alpha
[
pimldp
->
i
]);
if
(
!
bMask
&&
(
has_alpha
||
(
fState
&
ILS_ALPHA
)))
if
(
!
bMask
&&
(
has_alpha
||
(
fState
&
ILS_ALPHA
)
||
(
fState
&
ILS_SATURATE
)
))
{
COLORREF
colour
,
blend_col
=
CLR_NONE
;
BLENDFUNCTION
func
;
...
...
@@ -1441,8 +1453,8 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
if
(
bIsTransparent
)
{
bResult
=
alpha_blend_image
(
himl
,
pimldp
->
hdcDst
,
pimldp
->
x
,
pimldp
->
y
,
pt
.
x
,
pt
.
y
,
cx
,
cy
,
func
,
fStyle
,
blend_col
,
has_alpha
);
bResult
=
alpha_blend_image
(
himl
,
pimldp
->
hdcDst
,
pimldp
->
x
,
pimldp
->
y
,
pt
.
x
,
pt
.
y
,
cx
,
cy
,
func
,
fStyle
,
blend_col
,
has_alpha
,
fState
&
ILS_SATURATE
);
goto
end
;
}
colour
=
pimldp
->
rgbBk
;
...
...
@@ -1451,7 +1463,8 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
hOldBrush
=
SelectObject
(
hImageDC
,
CreateSolidBrush
(
colour
));
PatBlt
(
hImageDC
,
0
,
0
,
cx
,
cy
,
PATCOPY
);
alpha_blend_image
(
himl
,
hImageDC
,
0
,
0
,
pt
.
x
,
pt
.
y
,
cx
,
cy
,
func
,
fStyle
,
blend_col
,
has_alpha
);
alpha_blend_image
(
himl
,
hImageDC
,
0
,
0
,
pt
.
x
,
pt
.
y
,
cx
,
cy
,
func
,
fStyle
,
blend_col
,
has_alpha
,
fState
&
ILS_SATURATE
);
DeleteObject
(
SelectObject
(
hImageDC
,
hOldBrush
));
bResult
=
BitBlt
(
pimldp
->
hdcDst
,
pimldp
->
x
,
pimldp
->
y
,
cx
,
cy
,
hImageDC
,
0
,
0
,
SRCCOPY
);
goto
end
;
...
...
@@ -1545,7 +1558,6 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
}
}
if
(
fState
&
ILS_SATURATE
)
FIXME
(
"ILS_SATURATE: unimplemented!
\n
"
);
if
(
fState
&
ILS_GLOW
)
FIXME
(
"ILS_GLOW: unimplemented!
\n
"
);
if
(
fState
&
ILS_SHADOW
)
FIXME
(
"ILS_SHADOW: unimplemented!
\n
"
);
...
...
dlls/comctl32/tests/imagelist.c
View file @
d6305e1b
...
...
@@ -1475,7 +1475,6 @@ static void check_ImageList_DrawIndirect_grayscale(HDC hdc, HIMAGELIST himl, UIN
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
);
...
...
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