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
b1ac59b9
Commit
b1ac59b9
authored
Jan 05, 2015
by
Francois Gouget
Committed by
Alexandre Julliard
Jan 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11.drv: Make X11DRV_PALETTE_ComputeColorShifts() static.
parent
ec800242
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
59 deletions
+58
-59
palette.c
dlls/winex11.drv/palette.c
+58
-58
x11drv.h
dlls/winex11.drv/x11drv.h
+0
-1
No files found.
dlls/winex11.drv/palette.c
View file @
b1ac59b9
...
...
@@ -127,6 +127,64 @@ static void palette_set_mapping( HPALETTE hpal, int *mapping )
/***********************************************************************
* X11DRV_PALETTE_ComputeChannelShift
*
* Calculate conversion parameters for a given color mask
*/
static
void
X11DRV_PALETTE_ComputeChannelShift
(
unsigned
long
maskbits
,
ChannelShift
*
physical
,
ChannelShift
*
to_logical
)
{
int
i
;
if
(
maskbits
==
0
)
{
physical
->
shift
=
0
;
physical
->
scale
=
0
;
physical
->
max
=
0
;
to_logical
->
shift
=
0
;
to_logical
->
scale
=
0
;
to_logical
->
max
=
0
;
return
;
}
for
(
i
=
0
;
!
(
maskbits
&
1
);
i
++
)
maskbits
>>=
1
;
physical
->
shift
=
i
;
physical
->
max
=
maskbits
;
for
(
i
=
0
;
maskbits
!=
0
;
i
++
)
maskbits
>>=
1
;
physical
->
scale
=
i
;
if
(
physical
->
scale
>
8
)
{
/* On FreeBSD, VNC's default 32bpp mode is bgrabb (ffc00000,3ff800,7ff)!
* So we adjust the shifts to also normalize the color fields to
* the Win32 standard of 8 bits per color.
*/
to_logical
->
shift
=
physical
->
shift
+
(
physical
->
scale
-
8
);
to_logical
->
scale
=
8
;
to_logical
->
max
=
0xff
;
}
else
{
to_logical
->
shift
=
physical
->
shift
;
to_logical
->
scale
=
physical
->
scale
;
to_logical
->
max
=
physical
->
max
;
}
}
/***********************************************************************
* X11DRV_PALETTE_ComputeColorShifts
*
* Calculate conversion parameters for a given color
*/
static
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
);
}
/***********************************************************************
* COLOR_Init
*
* Initialize color management.
...
...
@@ -211,64 +269,6 @@ int X11DRV_PALETTE_Init(void)
}
/***********************************************************************
* X11DRV_PALETTE_ComputeChannelShift
*
* Calculate conversion parameters for a given color mask
*/
static
void
X11DRV_PALETTE_ComputeChannelShift
(
unsigned
long
maskbits
,
ChannelShift
*
physical
,
ChannelShift
*
to_logical
)
{
int
i
;
if
(
maskbits
==
0
)
{
physical
->
shift
=
0
;
physical
->
scale
=
0
;
physical
->
max
=
0
;
to_logical
->
shift
=
0
;
to_logical
->
scale
=
0
;
to_logical
->
max
=
0
;
return
;
}
for
(
i
=
0
;
!
(
maskbits
&
1
);
i
++
)
maskbits
>>=
1
;
physical
->
shift
=
i
;
physical
->
max
=
maskbits
;
for
(
i
=
0
;
maskbits
!=
0
;
i
++
)
maskbits
>>=
1
;
physical
->
scale
=
i
;
if
(
physical
->
scale
>
8
)
{
/* On FreeBSD, VNC's default 32bpp mode is bgrabb (ffc00000,3ff800,7ff)!
* So we adjust the shifts to also normalize the color fields to
* the Win32 standard of 8 bits per color.
*/
to_logical
->
shift
=
physical
->
shift
+
(
physical
->
scale
-
8
);
to_logical
->
scale
=
8
;
to_logical
->
max
=
0xff
;
}
else
{
to_logical
->
shift
=
physical
->
shift
;
to_logical
->
scale
=
physical
->
scale
;
to_logical
->
max
=
physical
->
max
;
}
}
/***********************************************************************
* 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 @
b1ac59b9
...
...
@@ -267,7 +267,6 @@ extern BOOL X11DRV_IsSolidColor(COLORREF color) DECLSPEC_HIDDEN;
extern
COLORREF
X11DRV_PALETTE_ToLogical
(
X11DRV_PDEVICE
*
physDev
,
int
pixel
)
DECLSPEC_HIDDEN
;
extern
int
X11DRV_PALETTE_ToPhysical
(
X11DRV_PDEVICE
*
physDev
,
COLORREF
color
)
DECLSPEC_HIDDEN
;
extern
COLORREF
X11DRV_PALETTE_GetColor
(
X11DRV_PDEVICE
*
physDev
,
COLORREF
color
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_PALETTE_ComputeColorShifts
(
ColorShifts
*
shifts
,
unsigned
long
redMask
,
unsigned
long
greenMask
,
unsigned
long
blueMask
)
DECLSPEC_HIDDEN
;
/* GDI escapes */
...
...
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