[gtk+] x11: Remove unused complexity
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] x11: Remove unused complexity
- Date: Thu, 3 Nov 2016 20:30:04 +0000 (UTC)
commit 4ebcb6fd1eac6cfa887246c1d91539e1b0e783b6
Author: Benjamin Otte <otte redhat com>
Date: Thu Nov 3 05:38:07 2016 +0100
x11: Remove unused complexity
With all Windows having the same visual, there's only ever one visual we
need to check.
gdk/x11/gdkglcontext-x11.c | 17 ++++++-----------
1 files changed, 6 insertions(+), 11 deletions(-)
---
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c
index 6d91ddf..92e852f 100644
--- a/gdk/x11/gdkglcontext-x11.c
+++ b/gdk/x11/gdkglcontext-x11.c
@@ -915,18 +915,16 @@ gdk_x11_screen_init_gl (GdkScreen *screen)
#define MAX_GLX_ATTRS 30
static gboolean
-find_fbconfig_for_visual (GdkDisplay *display,
- GdkVisual *visual,
- GLXFBConfig *fb_config_out,
- GError **error)
+find_fbconfig (GdkDisplay *display,
+ GLXFBConfig *fb_config_out,
+ GError **error)
{
static int attrs[MAX_GLX_ATTRS];
Display *dpy = gdk_x11_display_get_xdisplay (display);
GLXFBConfig *configs;
int n_configs, i;
- gboolean use_rgba;
gboolean retval = FALSE;
- VisualID xvisual_id = XVisualIDFromVisual(gdk_x11_visual_get_xvisual (visual));
+ VisualID xvisual_id = XVisualIDFromVisual (gdk_x11_visual_get_xvisual (gdk_x11_display_get_window_visual
(GDK_X11_DISPLAY (display))));
i = 0;
attrs[i++] = GLX_DRAWABLE_TYPE;
@@ -945,8 +943,7 @@ find_fbconfig_for_visual (GdkDisplay *display,
attrs[i++] = GLX_BLUE_SIZE;
attrs[i++] = 1;
- use_rgba = (visual == gdk_screen_get_rgba_visual (gdk_display_get_default_screen (display)));
- if (use_rgba)
+ if (gdk_display_is_rgba (display))
{
attrs[i++] = GLX_ALPHA_SIZE;
attrs[i++] = 1;
@@ -1263,7 +1260,6 @@ gdk_x11_window_create_gl_context (GdkWindow *window,
{
GdkDisplay *display;
GdkX11GLContext *context;
- GdkVisual *visual;
GLXFBConfig config;
display = gdk_window_get_display (window);
@@ -1276,8 +1272,7 @@ gdk_x11_window_create_gl_context (GdkWindow *window,
return NULL;
}
- visual = gdk_x11_display_get_window_visual (GDK_X11_DISPLAY (display));
- if (!find_fbconfig_for_visual (display, visual, &config, error))
+ if (!find_fbconfig (display, &config, error))
return NULL;
context = g_object_new (GDK_TYPE_X11_GL_CONTEXT,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]