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
56e804ee
Commit
56e804ee
authored
Aug 23, 2011
by
André Hentschel
Committed by
Alexandre Julliard
Aug 24, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Reject too bright gamma ramps.
parent
20fa3fe8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
dc.c
dlls/gdi32/tests/dc.c
+7
-0
xvidmode.c
dlls/winex11.drv/xvidmode.c
+5
-0
No files found.
dlls/gdi32/tests/dc.c
View file @
56e804ee
...
...
@@ -644,6 +644,13 @@ static void test_gamma(void)
ret
=
SetDeviceGammaRamp
(
hdc
,
&
ramp
);
ok
(
ret
,
"SetDeviceGammaRamp failed
\n
"
);
/* try a bright gamma ramp */
ramp
[
0
][
0
]
=
0
;
ramp
[
0
][
1
]
=
0x7FFF
;
for
(
i
=
2
;
i
<
256
;
i
++
)
ramp
[
0
][
i
]
=
0xFFFF
;
ret
=
SetDeviceGammaRamp
(
hdc
,
&
ramp
);
ok
(
!
ret
,
"SetDeviceGammaRamp succeeded
\n
"
);
/* cleanup: set old ramp again */
ret
=
SetDeviceGammaRamp
(
hdc
,
&
oldramp
);
ok
(
ret
,
"SetDeviceGammaRamp failed
\n
"
);
...
...
dlls/winex11.drv/xvidmode.c
View file @
56e804ee
...
...
@@ -339,6 +339,11 @@ static BOOL ComputeGammaFromRamp(WORD ramp[256], float *gamma)
ERR
(
"ramp not uniform (max=%f, min=%f, avg=%f), rejected
\n
"
,
g_max
,
g_min
,
g_avg
);
return
FALSE
;
}
/* check that the gamma is not too bright */
if
(
g_avg
<
0
.
2
)
{
ERR
(
"too bright gamma ( %5.3f), rejected
\n
"
,
g_avg
);
return
FALSE
;
}
/* ok, now we're pretty sure we can set the desired gamma ramp,
* so go for it */
*
gamma
=
1
/
g_avg
;
...
...
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