mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-04 05:58:22 +02:00
XQuartz: GL: Handle the alpha differently when the alpha is equal to GLCAPS_COLOR_BUF_INVALID_VALUE.
This prevents visuals with odd sizes. The machine I use didn't have this problem, but it shows up on some others.
This commit is contained in:
parent
373b8a5f32
commit
ed181382dd
1 changed files with 24 additions and 6 deletions
|
|
@ -149,12 +149,30 @@ void setVisualConfigs(void) {
|
|||
visualConfigs[i].redSize = conf->color_buffers[color].r;
|
||||
visualConfigs[i].greenSize = conf->color_buffers[color].g;
|
||||
visualConfigs[i].blueSize = conf->color_buffers[color].b;
|
||||
visualConfigs[i].alphaSize = conf->color_buffers[color].a;
|
||||
|
||||
visualConfigs[i].bufferSize = conf->color_buffers[color].r +
|
||||
conf->color_buffers[color].g + conf->color_buffers[color].b +
|
||||
conf->color_buffers[color].a;
|
||||
|
||||
|
||||
if(GLCAPS_COLOR_BUF_INVALID_VALUE == conf->color_buffers[color].a) {
|
||||
/* This visual has no alpha. */
|
||||
visualConfigs[i].alphaSize = 0;
|
||||
} else {
|
||||
visualConfigs[i].alphaSize = conf->color_buffers[color].a;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the .a/alpha value is unset, then don't add it to the
|
||||
* bufferSize specification. The INVALID_VALUE indicates that it
|
||||
* was unset.
|
||||
*
|
||||
* This prevents odd bufferSizes, such as 14.
|
||||
*/
|
||||
if(GLCAPS_COLOR_BUF_INVALID_VALUE == conf->color_buffers[color].a) {
|
||||
visualConfigs[i].bufferSize = conf->color_buffers[color].r +
|
||||
conf->color_buffers[color].g + conf->color_buffers[color].b;
|
||||
} else {
|
||||
visualConfigs[i].bufferSize = conf->color_buffers[color].r +
|
||||
conf->color_buffers[color].g + conf->color_buffers[color].b +
|
||||
conf->color_buffers[color].a;
|
||||
}
|
||||
|
||||
/*
|
||||
* I'm uncertain about these masks.
|
||||
* I don't think we actually care what the values are in our
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue