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
2da2f001
Commit
2da2f001
authored
Apr 28, 2012
by
Jeff Muizelaar
Committed by
Alexandre Julliard
Apr 30, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Improve performance of common case of AlphaBlend.
parent
6f40cb83
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
primitives.c
dlls/gdi32/dibdrv/primitives.c
+21
-2
No files found.
dlls/gdi32/dibdrv/primitives.c
View file @
2da2f001
...
...
@@ -3776,7 +3776,7 @@ static inline BYTE blend_color(BYTE dst, BYTE src, DWORD alpha)
return
(
src
*
alpha
+
dst
*
(
255
-
alpha
)
+
127
)
/
255
;
}
static
inline
DWORD
blend_argb
(
DWORD
dst
,
DWORD
src
,
DWORD
alpha
)
static
inline
DWORD
blend_argb
_constant_alpha
(
DWORD
dst
,
DWORD
src
,
DWORD
alpha
)
{
return
(
blend_color
(
dst
,
src
,
alpha
)
|
blend_color
(
dst
>>
8
,
src
>>
8
,
alpha
)
<<
8
|
...
...
@@ -3784,6 +3784,18 @@ static inline DWORD blend_argb( DWORD dst, DWORD src, DWORD alpha )
blend_color
(
dst
>>
24
,
src
>>
24
,
alpha
)
<<
24
);
}
static
inline
DWORD
blend_argb
(
DWORD
dst
,
DWORD
src
)
{
BYTE
b
=
(
BYTE
)
src
;
BYTE
g
=
(
BYTE
)(
src
>>
8
);
BYTE
r
=
(
BYTE
)(
src
>>
16
);
DWORD
alpha
=
(
BYTE
)(
src
>>
24
);
return
((
b
+
((
BYTE
)
dst
*
(
255
-
alpha
)
+
127
)
/
255
)
|
(
g
+
((
BYTE
)(
dst
>>
8
)
*
(
255
-
alpha
)
+
127
)
/
255
)
<<
8
|
(
r
+
((
BYTE
)(
dst
>>
16
)
*
(
255
-
alpha
)
+
127
)
/
255
)
<<
16
|
(
alpha
+
((
BYTE
)(
dst
>>
24
)
*
(
255
-
alpha
)
+
127
)
/
255
)
<<
24
);
}
static
inline
DWORD
blend_argb_alpha
(
DWORD
dst
,
DWORD
src
,
DWORD
alpha
)
{
BYTE
b
=
((
BYTE
)
src
*
alpha
+
127
)
/
255
;
...
...
@@ -3822,13 +3834,20 @@ static void blend_rect_8888(const dib_info *dst, const RECT *rc,
int
x
,
y
;
if
(
blend
.
AlphaFormat
&
AC_SRC_ALPHA
)
{
if
(
blend
.
SourceConstantAlpha
==
255
)
for
(
y
=
rc
->
top
;
y
<
rc
->
bottom
;
y
++
,
dst_ptr
+=
dst
->
stride
/
4
,
src_ptr
+=
src
->
stride
/
4
)
for
(
x
=
0
;
x
<
rc
->
right
-
rc
->
left
;
x
++
)
dst_ptr
[
x
]
=
blend_argb
(
dst_ptr
[
x
],
src_ptr
[
x
]
);
else
for
(
y
=
rc
->
top
;
y
<
rc
->
bottom
;
y
++
,
dst_ptr
+=
dst
->
stride
/
4
,
src_ptr
+=
src
->
stride
/
4
)
for
(
x
=
0
;
x
<
rc
->
right
-
rc
->
left
;
x
++
)
dst_ptr
[
x
]
=
blend_argb_alpha
(
dst_ptr
[
x
],
src_ptr
[
x
],
blend
.
SourceConstantAlpha
);
}
else
for
(
y
=
rc
->
top
;
y
<
rc
->
bottom
;
y
++
,
dst_ptr
+=
dst
->
stride
/
4
,
src_ptr
+=
src
->
stride
/
4
)
for
(
x
=
0
;
x
<
rc
->
right
-
rc
->
left
;
x
++
)
dst_ptr
[
x
]
=
blend_argb
(
dst_ptr
[
x
],
src_ptr
[
x
],
blend
.
SourceConstantAlpha
);
dst_ptr
[
x
]
=
blend_argb_constant_alpha
(
dst_ptr
[
x
],
src_ptr
[
x
],
blend
.
SourceConstantAlpha
);
}
static
void
blend_rect_32
(
const
dib_info
*
dst
,
const
RECT
*
rc
,
...
...
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