Fix passing of non-RGB visuals. The old code did not initialize the
structure properly which lead to a crash in 8bpp mode
This commit is contained in:
parent
f02440dfa3
commit
9af443f597
|
@ -1,3 +1,9 @@
|
||||||
|
2005-04-09 Alexander Gottwald <ago at freedesktop dot org>
|
||||||
|
|
||||||
|
* indirect.c:
|
||||||
|
Fix passing of non-RGB visuals. The old code did not initialize the
|
||||||
|
structure properly which lead to a crash in 8bpp mode
|
||||||
|
|
||||||
2005-03-01 Alexander Gottwald <ago at freedesktop dot org>
|
2005-03-01 Alexander Gottwald <ago at freedesktop dot org>
|
||||||
|
|
||||||
* indirect.c:
|
* indirect.c:
|
||||||
|
|
|
@ -995,6 +995,26 @@ static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static __GLXvisualConfig NullConfig = {
|
||||||
|
-1, /* vid */
|
||||||
|
-1, /* class */
|
||||||
|
False, /* rgba */
|
||||||
|
-1, -1, -1, 0, /* rgba sizes */
|
||||||
|
-1, -1, -1, 0, /* rgba masks */
|
||||||
|
0, 0, 0, 0, /* rgba accum sizes */
|
||||||
|
False, /* doubleBuffer */
|
||||||
|
False, /* stereo */
|
||||||
|
-1, /* bufferSize */
|
||||||
|
16, /* depthSize */
|
||||||
|
0, /* stencilSize */
|
||||||
|
0, /* auxBuffers */
|
||||||
|
0, /* level */
|
||||||
|
GLX_NONE_EXT, /* visualRating */
|
||||||
|
0, /* transparentPixel */
|
||||||
|
0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
|
||||||
|
0 /* transparentIndex */
|
||||||
|
};
|
||||||
|
|
||||||
static inline int count_bits(uint32_t x)
|
static inline int count_bits(uint32_t x)
|
||||||
{
|
{
|
||||||
x = x - ((x >> 1) & 0x55555555);
|
x = x - ((x >> 1) & 0x55555555);
|
||||||
|
@ -1137,7 +1157,6 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
|
||||||
int is_rgb = (pVisual[i].class == TrueColor ||
|
int is_rgb = (pVisual[i].class == TrueColor ||
|
||||||
pVisual[i].class == DirectColor);
|
pVisual[i].class == DirectColor);
|
||||||
|
|
||||||
#if 0
|
|
||||||
if (!is_rgb)
|
if (!is_rgb)
|
||||||
{
|
{
|
||||||
/* We don't support non-rgb visuals for GL. But we don't
|
/* We don't support non-rgb visuals for GL. But we don't
|
||||||
|
@ -1157,14 +1176,13 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
|
||||||
orig_vid[j] = pVisual[i].vid;
|
orig_vid[j] = pVisual[i].vid;
|
||||||
|
|
||||||
/* Initialize the glXVisual */
|
/* Initialize the glXVisual */
|
||||||
glXVisualPtr[j] = NullConfig;
|
_gl_copy_visual_to_context_mode( modes, & NullConfig );
|
||||||
glXVisualPriv[j] = NULL;
|
modes->visualID = pVisualNew[j].vid;
|
||||||
|
|
||||||
j++;
|
j++;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
for (k = 0; k < numNewConfigs; k++) {
|
for (k = 0; k < numNewConfigs; k++) {
|
||||||
if (pNewVisualConfigs[k].rgba != is_rgb)
|
if (pNewVisualConfigs[k].rgba != is_rgb)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user