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
62df608d
Commit
62df608d
authored
Mar 15, 2022
by
Jinoh Kang
Committed by
Alexandre Julliard
Mar 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Pre-multiply static control bitmap image by alpha for GdiAlphaBlend.
Signed-off-by:
Jinoh Kang
<
jinoh.kang.kr@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c4773e18
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
static.c
dlls/comctl32/static.c
+11
-0
static.c
dlls/comctl32/tests/static.c
+0
-2
No files found.
dlls/comctl32/static.c
View file @
62df608d
...
@@ -203,6 +203,17 @@ static HBITMAP create_alpha_bitmap( HBITMAP hbitmap )
...
@@ -203,6 +203,17 @@ static HBITMAP create_alpha_bitmap( HBITMAP hbitmap )
DeleteObject
(
alpha
);
DeleteObject
(
alpha
);
alpha
=
0
;
alpha
=
0
;
}
}
else
{
/* pre-multiply by alpha */
for
(
i
=
0
,
ptr
=
bits
;
i
<
bm
.
bmWidth
*
bm
.
bmHeight
;
i
++
,
ptr
+=
4
)
{
unsigned
int
alpha
=
ptr
[
3
];
ptr
[
0
]
=
(
ptr
[
0
]
*
alpha
+
127
)
/
255
;
ptr
[
1
]
=
(
ptr
[
1
]
*
alpha
+
127
)
/
255
;
ptr
[
2
]
=
(
ptr
[
2
]
*
alpha
+
127
)
/
255
;
}
}
}
}
DeleteDC
(
hdc
);
DeleteDC
(
hdc
);
...
...
dlls/comctl32/tests/static.c
View file @
62df608d
...
@@ -165,7 +165,6 @@ static void test_image(HBITMAP image, BOOL is_dib, BOOL is_premult, BOOL is_alph
...
@@ -165,7 +165,6 @@ static void test_image(HBITMAP image, BOOL is_dib, BOOL is_premult, BOOL is_alph
ok
(
bm
.
bmBits
!=
NULL
,
"bmBits is NULL
\n
"
);
ok
(
bm
.
bmBits
!=
NULL
,
"bmBits is NULL
\n
"
);
memcpy
(
bits
,
bm
.
bmBits
,
4
);
memcpy
(
bits
,
bm
.
bmBits
,
4
);
if
(
is_premult
)
if
(
is_premult
)
todo_wine
ok
(
bits
[
0
]
==
0x05
&&
bits
[
1
]
==
0x09
&&
bits
[
2
]
==
0x0e
&&
bits
[
3
]
==
0x44
,
ok
(
bits
[
0
]
==
0x05
&&
bits
[
1
]
==
0x09
&&
bits
[
2
]
==
0x0e
&&
bits
[
3
]
==
0x44
,
"bits: %02x %02x %02x %02x
\n
"
,
bits
[
0
],
bits
[
1
],
bits
[
2
],
bits
[
3
]);
"bits: %02x %02x %02x %02x
\n
"
,
bits
[
0
],
bits
[
1
],
bits
[
2
],
bits
[
3
]);
else
if
(
is_alpha
)
else
if
(
is_alpha
)
...
@@ -195,7 +194,6 @@ static void test_image(HBITMAP image, BOOL is_dib, BOOL is_premult, BOOL is_alph
...
@@ -195,7 +194,6 @@ static void test_image(HBITMAP image, BOOL is_dib, BOOL is_premult, BOOL is_alph
DeleteDC
(
hdc
);
DeleteDC
(
hdc
);
if
(
is_premult
)
if
(
is_premult
)
todo_wine
ok
(
bits
[
0
]
==
0x05
&&
bits
[
1
]
==
0x09
&&
bits
[
2
]
==
0x0e
&&
bits
[
3
]
==
0x44
,
ok
(
bits
[
0
]
==
0x05
&&
bits
[
1
]
==
0x09
&&
bits
[
2
]
==
0x0e
&&
bits
[
3
]
==
0x44
,
"bits: %02x %02x %02x %02x
\n
"
,
bits
[
0
],
bits
[
1
],
bits
[
2
],
bits
[
3
]);
"bits: %02x %02x %02x %02x
\n
"
,
bits
[
0
],
bits
[
1
],
bits
[
2
],
bits
[
3
]);
else
if
(
is_alpha
)
else
if
(
is_alpha
)
...
...
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