[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:
parent
eba3bab71f
commit
d1338a9480
|
@ -562,8 +562,8 @@ CMapRefreshColors(ColormapPtr pmap, int defs, int* indices)
|
||||||
|
|
||||||
switch(pVisual->class) {
|
switch(pVisual->class) {
|
||||||
case StaticGray:
|
case StaticGray:
|
||||||
for(i = 0; i <= numColors - 1; i++) {
|
for(i = 0; i < numColors; i++) {
|
||||||
index = i * maxValue / numColors;
|
index = (i+1) * maxValue / numColors;
|
||||||
colors[i].red = gamma[index].red;
|
colors[i].red = gamma[index].red;
|
||||||
colors[i].green = gamma[index].green;
|
colors[i].green = gamma[index].green;
|
||||||
colors[i].blue = gamma[index].blue;
|
colors[i].blue = gamma[index].blue;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user