dev-embedded/stlink: add
[sgilles-overlay.git] / media-libs / libsdl / files / libsdl-1.2.15-gamma.patch
bloba0582da9cecd9dbb266e84e8b614b08b3f80302f
1 From 4b56fa058a45b7c804d1a5fcaf7a70db0bd0581c Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <petr.pisar@atlas.cz>
3 Date: Tue, 1 Jan 2013 21:25:15 +0100
4 Subject: [PATCH] x11: Bypass SetGammaRamp when changing gamma
6 Recent Xorg has broken dynamic colors setting, so calling SDL_SetGamme()
7 does not have any effect here. Recent means xorg-server >= 1.7, since 2010.
8 See <https://bugs.freedesktop.org/show_bug.cgi?id=27222>.
9 ---
10 src/video/SDL_gamma.c | 15 ++-------------
11 1 files changed, 2 insertions(+), 13 deletions(-)
13 --- a/src/video/SDL_gamma.c
14 +++ b/src/video/SDL_gamma.c
15 @@ -92,22 +92,11 @@ static void CalculateGammaFromRamp(float *gamma, Uint16 *ramp)
17 int SDL_SetGamma(float red, float green, float blue)
19 - int succeeded;
20 + int succeeded = -1;
21 SDL_VideoDevice *video = current_video;
22 SDL_VideoDevice *this = current_video;
24 - succeeded = -1;
25 - /* Prefer using SetGammaRamp(), as it's more flexible */
26 - {
27 - Uint16 ramp[3][256];
29 - CalculateGammaRamp(red, ramp[0]);
30 - CalculateGammaRamp(green, ramp[1]);
31 - CalculateGammaRamp(blue, ramp[2]);
32 - succeeded = SDL_SetGammaRamp(ramp[0], ramp[1], ramp[2]);
33 - }
34 - if ( (succeeded < 0) && video->SetGamma ) {
35 - SDL_ClearError();
36 + if ( video->SetGamma ) {
37 succeeded = video->SetGamma(this, red, green, blue);
39 return succeeded;
40 --
41 1.7.8.6