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
ad73ed2d
Commit
ad73ed2d
authored
Oct 21, 2001
by
Andrew Lewycky
Committed by
Alexandre Julliard
Oct 21, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XFree86 4.1 gamma ramp support.
parent
c2edee01
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
xvidmode.c
dlls/x11drv/xvidmode.c
+46
-0
No files found.
dlls/x11drv/xvidmode.c
View file @
ad73ed2d
...
...
@@ -28,6 +28,11 @@ extern int usexvidmode;
static
int
xf86vm_event
,
xf86vm_error
,
xf86vm_major
,
xf86vm_minor
;
#ifdef X_XF86VidModeSetGammaRamp
static
int
xf86vm_gammaramp_size
;
static
BOOL
xf86vm_use_gammaramp
;
#endif
LPDDHALMODEINFO
xf86vm_modes
;
unsigned
xf86vm_mode_count
;
XF86VidModeModeInfo
**
modes
;
...
...
@@ -89,6 +94,19 @@ void X11DRV_XF86VM_Init(void)
if
(
!
TSXF86VidModeQueryExtension
(
gdi_display
,
&
xf86vm_event
,
&
xf86vm_error
))
return
;
if
(
!
TSXF86VidModeQueryVersion
(
gdi_display
,
&
xf86vm_major
,
&
xf86vm_minor
))
return
;
#ifdef X_XF86VidModeSetGammaRamp
if
(
xf86vm_major
>
2
||
(
xf86vm_major
==
2
&&
xf86vm_minor
>=
1
))
{
wine_tsx11_lock
();
XF86VidModeGetGammaRampSize
(
gdi_display
,
DefaultScreen
(
gdi_display
),
&
xf86vm_gammaramp_size
);
wine_tsx11_unlock
();
if
(
xf86vm_gammaramp_size
==
256
)
xf86vm_use_gammaramp
=
TRUE
;
}
#endif
/* retrieve modes */
if
(
!
TSXF86VidModeGetAllModeLines
(
gdi_display
,
DefaultScreen
(
gdi_display
),
&
nmodes
,
&
modes
))
...
...
@@ -264,6 +282,19 @@ BOOL X11DRV_XF86VM_GetGammaRamp(LPDDGAMMARAMP ramp)
Bool
ret
;
if
(
xf86vm_major
<
2
)
return
FALSE
;
/* no gamma control */
#ifdef X_XF86VidModeSetGammaRamp
else
if
(
xf86vm_use_gammaramp
)
{
Bool
ret
;
wine_tsx11_lock
();
ret
=
XF86VidModeGetGammaRamp
(
gdi_display
,
DefaultScreen
(
gdi_display
),
256
,
ramp
->
red
,
ramp
->
green
,
ramp
->
blue
);
wine_tsx11_unlock
();
return
ret
;
}
#endif
else
{
wine_tsx11_lock
();
ret
=
XF86VidModeGetGamma
(
gdi_display
,
DefaultScreen
(
gdi_display
),
&
gamma
);
wine_tsx11_unlock
();
...
...
@@ -273,6 +304,7 @@ BOOL X11DRV_XF86VM_GetGammaRamp(LPDDGAMMARAMP ramp)
GenerateRampFromGamma
(
ramp
->
blue
,
gamma
.
blue
);
return
TRUE
;
}
}
#endif
/* X_XF86VidModeSetGamma */
return
FALSE
;
}
...
...
@@ -283,6 +315,19 @@ BOOL X11DRV_XF86VM_SetGammaRamp(LPDDGAMMARAMP ramp)
XF86VidModeGamma
gamma
;
if
(
xf86vm_major
<
2
)
return
FALSE
;
/* no gamma control */
#ifdef X_XF86VidModeSetGammaRamp
else
if
(
xf86vm_use_gammaramp
)
{
Bool
ret
;
wine_tsx11_lock
();
ret
=
XF86VidModeSetGammaRamp
(
gdi_display
,
DefaultScreen
(
gdi_display
),
256
,
ramp
->
red
,
ramp
->
green
,
ramp
->
blue
);
wine_tsx11_unlock
();
return
ret
;
}
#endif
else
{
if
(
ComputeGammaFromRamp
(
ramp
->
red
,
&
gamma
.
red
)
&&
ComputeGammaFromRamp
(
ramp
->
green
,
&
gamma
.
green
)
&&
ComputeGammaFromRamp
(
ramp
->
blue
,
&
gamma
.
blue
))
{
...
...
@@ -292,6 +337,7 @@ BOOL X11DRV_XF86VM_SetGammaRamp(LPDDGAMMARAMP ramp)
wine_tsx11_unlock
();
return
ret
;
}
}
#endif
/* X_XF86VidModeSetGamma */
return
FALSE
;
}
...
...
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