Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
4ef7bd69
Commit
4ef7bd69
authored
15 years ago
by
Roderick Colenbrander
Committed by
Alexandre Julliard
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
winex11: Add helper function for calculating ColorShifts.
parent
bb457f7f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/winex11.drv/palette.c
+16
-7
16 additions, 7 deletions
dlls/winex11.drv/palette.c
dlls/winex11.drv/x11drv.h
+1
-0
1 addition, 0 deletions
dlls/winex11.drv/x11drv.h
with
17 additions
and
7 deletions
dlls/winex11.drv/palette.c
+
16
−
7
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_ComputeShift
s
* X11DRV_PALETTE_Compute
Channel
Shift
*
* Calculate conversion parameters for
direct mapped visuals
* Calculate conversion parameters for
a given color mask
*/
static
void
X11DRV_PALETTE_ComputeShift
s
(
unsigned
long
maskbits
,
ChannelShift
*
physical
,
ChannelShift
*
to_logical
)
static
void
X11DRV_PALETTE_Compute
Channel
Shift
(
unsigned
long
maskbits
,
ChannelShift
*
physical
,
ChannelShift
*
to_logical
)
{
int
i
;
...
...
@@ -326,6 +323,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
*
...
...
This diff is collapsed.
Click to expand it.
dlls/winex11.drv/x11drv.h
+
1
−
0
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment