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
4ef7bd69
Commit
4ef7bd69
authored
Sep 05, 2009
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Sep 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Add helper function for calculating ColorShifts.
parent
bb457f7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
palette.c
dlls/winex11.drv/palette.c
+16
-7
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-0
No files found.
dlls/winex11.drv/palette.c
View file @
4ef7bd69
...
...
@@ -101,7 +101,6 @@ int *X11DRV_PALETTE_XPixelToPalette = NULL;
static
BOOL
X11DRV_PALETTE_BuildPrivateMap
(
const
PALETTEENTRY
*
sys_pal_template
);
static
BOOL
X11DRV_PALETTE_BuildSharedMap
(
const
PALETTEENTRY
*
sys_pal_template
);
static
void
X11DRV_PALETTE_ComputeShifts
(
unsigned
long
maskbits
,
ChannelShift
*
physical
,
ChannelShift
*
to_logical
);
static
void
X11DRV_PALETTE_FillDefaultColors
(
const
PALETTEENTRY
*
sys_pal_template
);
static
void
X11DRV_PALETTE_FormatSystemPalette
(
void
);
static
BOOL
X11DRV_PALETTE_CheckSysColor
(
const
PALETTEENTRY
*
sys_pal_template
,
COLORREF
c
);
...
...
@@ -223,9 +222,7 @@ int X11DRV_PALETTE_Init(void)
X11DRV_PALETTE_PaletteXColormap
=
XCreateColormap
(
gdi_display
,
root_window
,
visual
,
AllocNone
);
X11DRV_PALETTE_PaletteFlags
|=
X11DRV_PALETTE_FIXED
;
X11DRV_PALETTE_ComputeShifts
(
visual
->
red_mask
,
&
X11DRV_PALETTE_default_shifts
.
physicalRed
,
&
X11DRV_PALETTE_default_shifts
.
logicalRed
);
X11DRV_PALETTE_ComputeShifts
(
visual
->
green_mask
,
&
X11DRV_PALETTE_default_shifts
.
physicalGreen
,
&
X11DRV_PALETTE_default_shifts
.
logicalGreen
);
X11DRV_PALETTE_ComputeShifts
(
visual
->
blue_mask
,
&
X11DRV_PALETTE_default_shifts
.
physicalBlue
,
&
X11DRV_PALETTE_default_shifts
.
logicalBlue
);
X11DRV_PALETTE_ComputeColorShifts
(
&
X11DRV_PALETTE_default_shifts
,
visual
->
red_mask
,
visual
->
green_mask
,
visual
->
blue_mask
);
}
XFree
(
depths
);
wine_tsx11_unlock
();
...
...
@@ -281,11 +278,11 @@ void X11DRV_PALETTE_Cleanup(void)
}
/***********************************************************************
* X11DRV_PALETTE_Compute
Shifts
* X11DRV_PALETTE_Compute
ChannelShift
*
* Calculate conversion parameters for
direct mapped visuals
* Calculate conversion parameters for
a given color mask
*/
static
void
X11DRV_PALETTE_Compute
Shifts
(
unsigned
long
maskbits
,
ChannelShift
*
physical
,
ChannelShift
*
to_logical
)
static
void
X11DRV_PALETTE_Compute
ChannelShift
(
unsigned
long
maskbits
,
ChannelShift
*
physical
,
ChannelShift
*
to_logical
)
{
int
i
;
...
...
@@ -327,6 +324,18 @@ static void X11DRV_PALETTE_ComputeShifts(unsigned long maskbits, ChannelShift *p
}
/***********************************************************************
* X11DRV_PALETTE_ComputeColorShifts
*
* Calculate conversion parameters for a given color
*/
void
X11DRV_PALETTE_ComputeColorShifts
(
ColorShifts
*
shifts
,
unsigned
long
redMask
,
unsigned
long
greenMask
,
unsigned
long
blueMask
)
{
X11DRV_PALETTE_ComputeChannelShift
(
redMask
,
&
shifts
->
physicalRed
,
&
shifts
->
logicalRed
);
X11DRV_PALETTE_ComputeChannelShift
(
greenMask
,
&
shifts
->
physicalGreen
,
&
shifts
->
logicalGreen
);
X11DRV_PALETTE_ComputeChannelShift
(
blueMask
,
&
shifts
->
physicalBlue
,
&
shifts
->
logicalBlue
);
}
/***********************************************************************
* X11DRV_PALETTE_BuildPrivateMap
*
* Allocate colorcells and initialize mapping tables.
...
...
dlls/winex11.drv/x11drv.h
View file @
4ef7bd69
...
...
@@ -493,6 +493,7 @@ extern BOOL X11DRV_IsSolidColor(COLORREF color);
extern
COLORREF
X11DRV_PALETTE_ToLogical
(
X11DRV_PDEVICE
*
physDev
,
int
pixel
);
extern
int
X11DRV_PALETTE_ToPhysical
(
X11DRV_PDEVICE
*
physDev
,
COLORREF
color
);
extern
int
X11DRV_PALETTE_LookupPixel
(
COLORREF
color
);
extern
void
X11DRV_PALETTE_ComputeColorShifts
(
ColorShifts
*
shifts
,
unsigned
long
redMask
,
unsigned
long
greenMask
,
unsigned
long
blueMask
);
extern
unsigned
int
depth_to_bpp
(
unsigned
int
depth
);
...
...
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