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
913160d2
Commit
913160d2
authored
May 28, 2018
by
Józef Kucia
Committed by
Alexandre Julliard
May 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Introduce GAMMA_RAMP_SIZE.
Signed-off-by:
Józef Kucia
<
jkucia@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f181e714
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
x11drv.h
dlls/winex11.drv/x11drv.h
+5
-3
xvidmode.c
dlls/winex11.drv/xvidmode.c
+6
-6
No files found.
dlls/winex11.drv/x11drv.h
View file @
913160d2
...
...
@@ -114,11 +114,13 @@ typedef struct
int
exposures
;
/* count of graphics exposures operations */
}
X11DRV_PDEVICE
;
#define GAMMA_RAMP_SIZE 256
struct
x11drv_gamma_ramp
{
WORD
red
[
256
];
WORD
green
[
256
];
WORD
blue
[
256
];
WORD
red
[
GAMMA_RAMP_SIZE
];
WORD
green
[
GAMMA_RAMP_SIZE
];
WORD
blue
[
GAMMA_RAMP_SIZE
];
};
static
inline
X11DRV_PDEVICE
*
get_x11drv_dev
(
PHYSDEV
dev
)
...
...
dlls/winex11.drv/xvidmode.c
View file @
913160d2
...
...
@@ -202,7 +202,7 @@ void X11DRV_XF86VM_Init(void)
pXF86VidModeGetGammaRampSize
(
gdi_display
,
DefaultScreen
(
gdi_display
),
&
xf86vm_gammaramp_size
);
if
(
X11DRV_check_error
())
xf86vm_gammaramp_size
=
0
;
if
(
xf86vm_gammaramp_size
==
256
)
if
(
xf86vm_gammaramp_size
==
GAMMA_RAMP_SIZE
)
xf86vm_use_gammaramp
=
TRUE
;
}
#endif
/* X_XF86VidModeSetGammaRamp */
...
...
@@ -250,16 +250,16 @@ sym_not_found:
#ifdef X_XF86VidModeSetGamma
static
void
GenerateRampFromGamma
(
WORD
ramp
[
256
],
float
gamma
)
static
void
GenerateRampFromGamma
(
WORD
ramp
[
GAMMA_RAMP_SIZE
],
float
gamma
)
{
float
r_gamma
=
1
/
gamma
;
unsigned
i
;
TRACE
(
"gamma is %f
\n
"
,
r_gamma
);
for
(
i
=
0
;
i
<
256
;
i
++
)
for
(
i
=
0
;
i
<
GAMMA_RAMP_SIZE
;
i
++
)
ramp
[
i
]
=
pow
(
i
/
255
.
0
,
r_gamma
)
*
65535
.
0
;
}
static
BOOL
ComputeGammaFromRamp
(
WORD
ramp
[
256
],
float
*
gamma
)
static
BOOL
ComputeGammaFromRamp
(
WORD
ramp
[
GAMMA_RAMP_SIZE
],
float
*
gamma
)
{
float
r_x
,
r_y
,
r_lx
,
r_ly
,
r_d
,
r_v
,
r_e
,
g_avg
,
g_min
,
g_max
;
unsigned
i
,
f
,
l
,
g_n
,
c
;
...
...
@@ -342,7 +342,7 @@ static BOOL X11DRV_XF86VM_GetGammaRamp(struct x11drv_gamma_ramp *ramp)
if
(
xf86vm_major
<
2
)
return
FALSE
;
/* no gamma control */
#ifdef X_XF86VidModeSetGammaRamp
if
(
xf86vm_use_gammaramp
)
return
pXF86VidModeGetGammaRamp
(
gdi_display
,
DefaultScreen
(
gdi_display
),
256
,
return
pXF86VidModeGetGammaRamp
(
gdi_display
,
DefaultScreen
(
gdi_display
),
GAMMA_RAMP_SIZE
,
ramp
->
red
,
ramp
->
green
,
ramp
->
blue
);
#endif
if
(
pXF86VidModeGetGamma
(
gdi_display
,
DefaultScreen
(
gdi_display
),
&
gamma
))
...
...
@@ -367,7 +367,7 @@ static BOOL X11DRV_XF86VM_SetGammaRamp(struct x11drv_gamma_ramp *ramp)
!
ComputeGammaFromRamp
(
ramp
->
blue
,
&
gamma
.
blue
))
return
FALSE
;
#ifdef X_XF86VidModeSetGammaRamp
if
(
xf86vm_use_gammaramp
)
return
pXF86VidModeSetGammaRamp
(
gdi_display
,
DefaultScreen
(
gdi_display
),
256
,
return
pXF86VidModeSetGammaRamp
(
gdi_display
,
DefaultScreen
(
gdi_display
),
GAMMA_RAMP_SIZE
,
ramp
->
red
,
ramp
->
green
,
ramp
->
blue
);
#endif
return
pXF86VidModeSetGamma
(
gdi_display
,
DefaultScreen
(
gdi_display
),
&
gamma
);
...
...
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