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
15efbc89
Commit
15efbc89
authored
May 18, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/imagelist: Don't pre-multiply the stored image, do it only at blending time.
parent
2c80e14e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
22 deletions
+14
-22
imagelist.c
dlls/comctl32/imagelist.c
+14
-22
No files found.
dlls/comctl32/imagelist.c
View file @
15efbc89
...
@@ -212,20 +212,6 @@ static BOOL add_with_alpha( HIMAGELIST himl, HDC hdc, int pos, int count,
...
@@ -212,20 +212,6 @@ static BOOL add_with_alpha( HIMAGELIST himl, HDC hdc, int pos, int count,
{
{
if
(
himl
->
has_alpha
)
himl
->
has_alpha
[
pos
+
n
]
=
1
;
if
(
himl
->
has_alpha
)
himl
->
has_alpha
[
pos
+
n
]
=
1
;
/* pre-multiply by the alpha channel */
for
(
i
=
0
;
i
<
height
;
i
++
)
{
for
(
j
=
n
*
width
;
j
<
(
n
+
1
)
*
width
;
j
++
)
{
DWORD
argb
=
bits
[
i
*
bm
.
bmWidth
+
j
];
DWORD
alpha
=
argb
>>
24
;
bits
[
i
*
bm
.
bmWidth
+
j
]
=
((
argb
&
0xff000000
)
|
(((
argb
&
0x00ff0000
)
*
alpha
/
255
)
&
0x00ff0000
)
|
(((
argb
&
0x0000ff00
)
*
alpha
/
255
)
&
0x0000ff00
)
|
(((
argb
&
0x000000ff
)
*
alpha
/
255
)));
}
}
if
(
mask_info
&&
himl
->
hbmMask
)
/* generate the mask from the alpha channel */
if
(
mask_info
&&
himl
->
hbmMask
)
/* generate the mask from the alpha channel */
{
{
for
(
i
=
0
;
i
<
height
;
i
++
)
for
(
i
=
0
;
i
<
height
;
i
++
)
...
@@ -247,6 +233,7 @@ static BOOL add_with_alpha( HIMAGELIST himl, HDC hdc, int pos, int count,
...
@@ -247,6 +233,7 @@ static BOOL add_with_alpha( HIMAGELIST himl, HDC hdc, int pos, int count,
done:
done:
if
(
hdcMask
)
DeleteDC
(
hdcMask
);
if
(
hdcMask
)
DeleteDC
(
hdcMask
);
HeapFree
(
GetProcessHeap
(),
0
,
info
);
HeapFree
(
GetProcessHeap
(),
0
,
info
);
HeapFree
(
GetProcessHeap
(),
0
,
mask_info
);
HeapFree
(
GetProcessHeap
(),
0
,
bits
);
HeapFree
(
GetProcessHeap
(),
0
,
bits
);
HeapFree
(
GetProcessHeap
(),
0
,
mask_bits
);
HeapFree
(
GetProcessHeap
(),
0
,
mask_bits
);
return
ret
;
return
ret
;
...
@@ -1195,7 +1182,19 @@ static BOOL alpha_blend_image( HIMAGELIST himl, HDC dest_dc, int dest_x, int des
...
@@ -1195,7 +1182,19 @@ static BOOL alpha_blend_image( HIMAGELIST himl, HDC dest_dc, int dest_x, int des
SelectObject
(
hdc
,
bmp
);
SelectObject
(
hdc
,
bmp
);
BitBlt
(
hdc
,
0
,
0
,
cx
,
cy
,
himl
->
hdcImage
,
src_x
,
src_y
,
SRCCOPY
);
BitBlt
(
hdc
,
0
,
0
,
cx
,
cy
,
himl
->
hdcImage
,
src_x
,
src_y
,
SRCCOPY
);
if
(
himl
->
hbmMask
)
if
(
himl
->
uBitsPixel
==
32
)
/* we already have an alpha channel in this case */
{
/* pre-multiply by the alpha channel */
for
(
i
=
0
,
ptr
=
bits
;
i
<
cx
*
cy
;
i
++
,
ptr
++
)
{
DWORD
alpha
=
*
ptr
>>
24
;
*
ptr
=
((
*
ptr
&
0xff000000
)
|
(((
*
ptr
&
0x00ff0000
)
*
alpha
/
255
)
&
0x00ff0000
)
|
(((
*
ptr
&
0x0000ff00
)
*
alpha
/
255
)
&
0x0000ff00
)
|
(((
*
ptr
&
0x000000ff
)
*
alpha
/
255
)));
}
}
else
if
(
himl
->
hbmMask
)
{
{
unsigned
int
width_bytes
=
(
cx
+
31
)
/
32
*
4
;
unsigned
int
width_bytes
=
(
cx
+
31
)
/
32
*
4
;
/* generate alpha channel from the mask */
/* generate alpha channel from the mask */
...
@@ -1311,10 +1310,6 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
...
@@ -1311,10 +1310,6 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
if
(
bIsTransparent
)
if
(
bIsTransparent
)
{
{
if
(
himl
->
uBitsPixel
==
32
)
/* we already have an alpha channel in this case */
bResult
=
GdiAlphaBlend
(
pimldp
->
hdcDst
,
pimldp
->
x
,
pimldp
->
y
,
cx
,
cy
,
himl
->
hdcImage
,
pt
.
x
,
pt
.
y
,
cx
,
cy
,
func
);
else
bResult
=
alpha_blend_image
(
himl
,
pimldp
->
hdcDst
,
pimldp
->
x
,
pimldp
->
y
,
bResult
=
alpha_blend_image
(
himl
,
pimldp
->
hdcDst
,
pimldp
->
x
,
pimldp
->
y
,
pt
.
x
,
pt
.
y
,
cx
,
cy
,
func
);
pt
.
x
,
pt
.
y
,
cx
,
cy
,
func
);
goto
end
;
goto
end
;
...
@@ -1325,9 +1320,6 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
...
@@ -1325,9 +1320,6 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
hOldBrush
=
SelectObject
(
hImageDC
,
CreateSolidBrush
(
colour
));
hOldBrush
=
SelectObject
(
hImageDC
,
CreateSolidBrush
(
colour
));
PatBlt
(
hImageDC
,
0
,
0
,
cx
,
cy
,
PATCOPY
);
PatBlt
(
hImageDC
,
0
,
0
,
cx
,
cy
,
PATCOPY
);
if
(
himl
->
uBitsPixel
==
32
)
GdiAlphaBlend
(
hImageDC
,
0
,
0
,
cx
,
cy
,
himl
->
hdcImage
,
pt
.
x
,
pt
.
y
,
cx
,
cy
,
func
);
else
alpha_blend_image
(
himl
,
hImageDC
,
0
,
0
,
pt
.
x
,
pt
.
y
,
cx
,
cy
,
func
);
alpha_blend_image
(
himl
,
hImageDC
,
0
,
0
,
pt
.
x
,
pt
.
y
,
cx
,
cy
,
func
);
DeleteObject
(
SelectObject
(
hImageDC
,
hOldBrush
));
DeleteObject
(
SelectObject
(
hImageDC
,
hOldBrush
));
bResult
=
BitBlt
(
pimldp
->
hdcDst
,
pimldp
->
x
,
pimldp
->
y
,
cx
,
cy
,
hImageDC
,
0
,
0
,
SRCCOPY
);
bResult
=
BitBlt
(
pimldp
->
hdcDst
,
pimldp
->
x
,
pimldp
->
y
,
cx
,
cy
,
hImageDC
,
0
,
0
,
SRCCOPY
);
...
...
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