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
dcf526b5
Commit
dcf526b5
authored
Jan 26, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Force the alpha bits in the window surface for 32-bit visuals.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a2a2b5bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
bitblt.c
dlls/winex11.drv/bitblt.c
+18
-5
No files found.
dlls/winex11.drv/bitblt.c
View file @
dcf526b5
...
...
@@ -1067,8 +1067,8 @@ static inline BOOL image_needs_byteswap( XImage *image, BOOL is_r8g8b8, int bit_
/* copy image bits with byte swapping and/or pixel mapping */
static
void
copy_image_byteswap
(
BITMAPINFO
*
info
,
const
unsigned
char
*
src
,
unsigned
char
*
dst
,
int
src_stride
,
int
dst_stride
,
int
height
,
BOOL
byteswap
,
const
int
*
mapping
,
unsigned
int
zeropad_mask
)
int
src_stride
,
int
dst_stride
,
int
height
,
BOOL
byteswap
,
const
int
*
mapping
,
unsigned
int
zeropad_mask
,
unsigned
int
alpha_bits
)
{
int
x
,
y
,
padding_pos
=
abs
(
dst_stride
)
/
sizeof
(
unsigned
int
)
-
1
;
...
...
@@ -1148,7 +1148,7 @@ static void copy_image_byteswap( BITMAPINFO *info, const unsigned char *src, uns
case
32
:
for
(
y
=
0
;
y
<
height
;
y
++
,
src
+=
src_stride
,
dst
+=
dst_stride
)
for
(
x
=
0
;
x
<
info
->
bmiHeader
.
biWidth
;
x
++
)
((
ULONG
*
)
dst
)[
x
]
=
RtlUlongByteSwap
(
((
const
ULONG
*
)
src
)[
x
]
);
((
ULONG
*
)
dst
)[
x
]
=
RtlUlongByteSwap
(
((
const
ULONG
*
)
src
)[
x
]
|
alpha_bits
);
break
;
}
}
...
...
@@ -1200,7 +1200,7 @@ DWORD copy_image_bits( BITMAPINFO *info, BOOL is_r8g8b8, XImage *image,
}
copy_image_byteswap
(
info
,
src
,
dst
,
image
->
bytes_per_line
,
width_bytes
,
height
,
need_byteswap
,
mapping
,
zeropad_mask
);
need_byteswap
,
mapping
,
zeropad_mask
,
0
);
return
ERROR_SUCCESS
;
}
...
...
@@ -1565,6 +1565,7 @@ struct x11drv_window_surface
RECT
bounds
;
BOOL
byteswap
;
BOOL
is_argb
;
DWORD
alpha_bits
;
COLORREF
color_key
;
HRGN
region
;
void
*
bits
;
...
...
@@ -1918,7 +1919,16 @@ static void x11drv_surface_flush( struct window_surface *window_surface )
dst
+=
coords
.
visrect
.
top
*
width_bytes
;
copy_image_byteswap
(
&
surface
->
info
,
src
,
dst
,
width_bytes
,
width_bytes
,
coords
.
visrect
.
bottom
-
coords
.
visrect
.
top
,
surface
->
byteswap
,
mapping
,
~
0u
);
surface
->
byteswap
,
mapping
,
~
0u
,
surface
->
alpha_bits
);
}
else
if
(
surface
->
alpha_bits
)
{
int
x
,
y
,
stride
=
surface
->
image
->
bytes_per_line
/
sizeof
(
ULONG
);
ULONG
*
ptr
=
(
ULONG
*
)
dst
+
coords
.
visrect
.
top
*
stride
;
for
(
y
=
coords
.
visrect
.
top
;
y
<
coords
.
visrect
.
bottom
;
y
++
,
ptr
+=
stride
)
for
(
x
=
coords
.
visrect
.
left
;
x
<
coords
.
visrect
.
right
;
x
++
)
ptr
[
x
]
|=
surface
->
alpha_bits
;
}
#ifdef HAVE_LIBXXSHM
...
...
@@ -2033,6 +2043,9 @@ struct window_surface *create_surface( Window window, const XVisualInfo *vis, co
XSetSubwindowMode
(
gdi_display
,
surface
->
gc
,
IncludeInferiors
);
surface
->
byteswap
=
image_needs_byteswap
(
surface
->
image
,
is_r8g8b8
(
vis
),
format
->
bits_per_pixel
);
if
(
vis
->
depth
==
32
&&
!
surface
->
is_argb
)
surface
->
alpha_bits
=
~
(
vis
->
red_mask
|
vis
->
green_mask
|
vis
->
blue_mask
);
if
(
surface
->
byteswap
||
format
->
bits_per_pixel
==
4
||
format
->
bits_per_pixel
==
8
)
{
/* allocate separate surface bits if byte swapping or palette mapping is required */
...
...
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