[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>
This commit is contained in:
Winfried Grünewald 2009-03-06 12:59:35 -05:00 committed by James Cloos
parent eba3bab71f
commit d1338a9480

View File

@ -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;