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
bb457f7f
Commit
bb457f7f
authored
Sep 02, 2009
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Sep 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Use ColorShifts in get_xrender_format_from_pdevice.
parent
e789b1e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
13 deletions
+30
-13
xrender.c
dlls/winex11.drv/xrender.c
+30
-13
No files found.
dlls/winex11.drv/xrender.c
View file @
bb457f7f
...
...
@@ -429,21 +429,38 @@ static WineXRenderFormat *get_xrender_format(WXRFormat format)
static
WineXRenderFormat
*
get_xrender_format_from_pdevice
(
X11DRV_PDEVICE
*
physDev
)
{
WXRFormat
format
;
switch
(
physDev
->
depth
)
if
(
physDev
->
depth
==
1
)
return
get_xrender_format
(
WXR_FORMAT_MONO
);
/* physDevs of a depth <=8, don't have color_shifts set and XRender can't handle those except for 1-bit */
else
if
(
!
physDev
->
color_shifts
)
return
default_format
;
else
{
case
1
:
format
=
WXR_FORMAT_MONO
;
break
;
default:
/* For now fall back to the format of the default visual.
In the future we should check if we are using a DDB/DIB and what exact format we need.
*/
return
default_format
;
}
int
redMask
=
0
,
greenMask
=
0
,
blueMask
=
0
;
int
i
;
ColorShifts
*
shifts
=
physDev
->
color_shifts
;
redMask
=
shifts
->
physicalRed
.
max
<<
shifts
->
physicalRed
.
shift
;
greenMask
=
shifts
->
physicalGreen
.
max
<<
shifts
->
physicalGreen
.
shift
;
blueMask
=
shifts
->
physicalBlue
.
max
<<
shifts
->
physicalBlue
.
shift
;
/* Try to locate a format which matches the specification of the dibsection. */
for
(
i
=
0
;
i
<
(
sizeof
(
wxr_formats_template
)
/
sizeof
(
wxr_formats_template
[
0
]));
i
++
)
{
if
(
physDev
->
depth
==
wxr_formats_template
[
i
].
depth
&&
redMask
==
(
wxr_formats_template
[
i
].
redMask
<<
wxr_formats_template
[
i
].
red
)
&&
greenMask
==
(
wxr_formats_template
[
i
].
greenMask
<<
wxr_formats_template
[
i
].
green
)
&&
blueMask
==
(
wxr_formats_template
[
i
].
blueMask
<<
wxr_formats_template
[
i
].
blue
)
)
return
get_xrender_format
(
format
);
{
/* When we reach this stage the format was found in our template table but this doesn't mean that
* the Xserver also supports this format (e.g. its depth might be too low). The call below verifies that.
*/
return
get_xrender_format
(
wxr_formats_template
[
i
].
wxr_format
);
}
}
}
return
NULL
;
}
static
BOOL
fontcmp
(
LFANDSIZE
*
p1
,
LFANDSIZE
*
p2
)
...
...
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