summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorWinfried Grünewald <winfried.gruenewald.ext@eizo-dt.de>2009-03-06 12:59:35 -0500
committerJames Cloos <cloos@jhcloos.com>2009-03-06 12:59:35 -0500
commitd1338a94805cc774fe0a5d00c2225a3ee9673a9f (patch)
tree631d06a4b853496a22ef4f632decc46c5feaf8ad /hw
parenteba3bab71ff26d58bb0e49e4a9726fc21ff07258 (diff)
[hw/xfree86] Fix StaticGray cmap.
Fix this bug report: ,----< from http://bugzilla.freedesktop.org/show_bug.cgi?id=20504 > | Using the Visual StaticGray (8 bit depth) is missing one gray level. | The gray level of index zero and index one are the same and all | other levels are shifted by one. The max level (255) cannot be used. `---- Signed-off-by: James Cloos <cloos@jhcloos.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/common/xf86cmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/xfree86/common/xf86cmap.c b/hw/xfree86/common/xf86cmap.c
index be50a5c6a..316470df4 100644
--- a/hw/xfree86/common/xf86cmap.c
+++ b/hw/xfree86/common/xf86cmap.c
@@ -562,8 +562,8 @@ CMapRefreshColors(ColormapPtr pmap, int defs, int* indices)
switch(pVisual->class) {
case StaticGray:
- for(i = 0; i <= numColors - 1; i++) {
- index = i * maxValue / numColors;
+ for(i = 0; i < numColors; i++) {
+ index = (i+1) * maxValue / numColors;
colors[i].red = gamma[index].red;
colors[i].green = gamma[index].green;
colors[i].blue = gamma[index].blue;