diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2014-08-11 21:26:48 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2014-08-12 10:39:29 +0100 |
commit | 0500963db9b7ba500beb92d88354beec6070baea (patch) | |
tree | 3aca0b890aa00511e50b6fc20b6ba83155a16453 | |
parent | bc9180d6102e532773495a1e7beceaa9ab52f102 (diff) | |
download | gtk+-0500963db9b7ba500beb92d88354beec6070baea.tar.gz |
x11: Fix conversion of pixel format to GL attributes
The color-size pixel format property is the size of each color buffer
channel.
We also need to set a default for the samples per sample buffer.
-rw-r--r-- | gdk/x11/gdkglcontext-x11.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c index 48fe93c726..f7d1da8200 100644 --- a/gdk/x11/gdkglcontext-x11.c +++ b/gdk/x11/gdkglcontext-x11.c @@ -307,14 +307,12 @@ get_glx_attributes_for_pixel_format (GdkDisplay *display, } else { - int channel_size = format->color_size / 4; - attrs[i++] = GLX_RED_SIZE; - attrs[i++] = channel_size; + attrs[i++] = format->color_size; attrs[i++] = GLX_GREEN_SIZE; - attrs[i++] = channel_size; + attrs[i++] = format->color_size; attrs[i++] = GLX_BLUE_SIZE; - attrs[i++] = channel_size; + attrs[i++] = format->color_size; } if (format->alpha_size < 0) @@ -362,7 +360,7 @@ get_glx_attributes_for_pixel_format (GdkDisplay *display, attrs[i++] = format->sample_buffers > 0 ? format->sample_buffers : 1; attrs[i++] = GLX_SAMPLES; - attrs[i++] = format->samples; + attrs[i++] = format->samples > 0 ? format->samples : 1; } attrs[i++] = None; |