[gtk+] Remove GdkGLContext::visual



commit f0ae8da99378adcd89587b5ce702de0a179753f2
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Oct 30 12:15:51 2014 +0100

    Remove GdkGLContext::visual
    
    This is not really needed. The gl context is totally tied to the
    window it is created from by virtue of sharing the context with the
    paint context of that window and that context always has the visual
    of the window (which we already can get).
    
    Also, all user visible contexts are essentially offscreen contexts, so
    a visual doesn't make sense for them. They only use FBOs which have
    whatever format that the users sets up.

 docs/reference/gdk/gdk3-sections.txt |    1 -
 gdk/gdkglcontext.c                   |   53 ----------------------------------
 gdk/gdkglcontext.h                   |    2 -
 gdk/wayland/gdkglcontext-wayland.c   |    1 -
 gdk/x11/gdkglcontext-x11.c           |    5 ---
 5 files changed, 0 insertions(+), 62 deletions(-)
---
diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt
index 8281d53..97ef4f7 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -1286,7 +1286,6 @@ gdk_frame_get_type
 <SECTION>
 <FILE>gdkglcontext</FILE>
 GdkGLContext
-gdk_gl_context_get_visual
 gdk_gl_context_get_window
 gdk_gl_context_make_current
 gdk_gl_context_clear_current
diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c
index b15b76e..f64c23d 100644
--- a/gdk/gdkglcontext.c
+++ b/gdk/gdkglcontext.c
@@ -72,7 +72,6 @@
 
 #include "gdkglcontextprivate.h"
 #include "gdkdisplayprivate.h"
-#include "gdkvisual.h"
 #include "gdkinternals.h"
 
 #include "gdkintl.h"
@@ -81,7 +80,6 @@
 
 typedef struct {
   GdkWindow *window;
-  GdkVisual *visual;
   GdkGLContext *shared_context;
 
   guint realized : 1;
@@ -93,7 +91,6 @@ enum {
   PROP_0,
 
   PROP_WINDOW,
-  PROP_VISUAL,
   PROP_SHARED_CONTEXT,
 
   LAST_PROP
@@ -119,7 +116,6 @@ gdk_gl_context_dispose (GObject *gobject)
     g_private_replace (&thread_current_context, NULL);
 
   g_clear_object (&priv->window);
-  g_clear_object (&priv->visual);
   g_clear_object (&priv->shared_context);
 
   G_OBJECT_CLASS (gdk_gl_context_parent_class)->dispose (gobject);
@@ -149,15 +145,6 @@ gdk_gl_context_set_property (GObject      *gobject,
       }
       break;
 
-    case PROP_VISUAL:
-      {
-        GdkVisual *visual = g_value_get_object (value);
-
-        if (visual != NULL)
-          priv->visual = g_object_ref (visual);
-      }
-      break;
-
     case PROP_SHARED_CONTEXT:
       {
         GdkGLContext *context = g_value_get_object (value);
@@ -186,10 +173,6 @@ gdk_gl_context_get_property (GObject    *gobject,
       g_value_set_object (value, priv->window);
       break;
 
-    case PROP_VISUAL:
-      g_value_set_object (value, priv->visual);
-      break;
-
     case PROP_SHARED_CONTEXT:
       g_value_set_object (value, priv->shared_context);
       break;
@@ -221,22 +204,6 @@ gdk_gl_context_class_init (GdkGLContextClass *klass)
                          G_PARAM_STATIC_STRINGS);
 
   /**
-   * GdkGLContext:visual:
-   *
-   * The #GdkVisual matching the pixel format used by the context.
-   *
-   * Since: 3.16
-   */
-  obj_pspecs[PROP_VISUAL] =
-    g_param_spec_object ("visual",
-                         P_("Visual"),
-                         P_("The GDK visual used by the GL context"),
-                         GDK_TYPE_VISUAL,
-                         G_PARAM_READWRITE |
-                         G_PARAM_CONSTRUCT_ONLY |
-                         G_PARAM_STATIC_STRINGS);
-
-  /**
    * GdkGLContext:shared-context:
    *
    * The #GdkGLContext that this context is sharing data with, or #NULL
@@ -264,26 +231,6 @@ gdk_gl_context_init (GdkGLContext *self)
 {
 }
 
-/**
- * gdk_gl_context_get_visual:
- * @context: a #GdkGLContext
- *
- * Retrieves the #GdkVisual associated with the @context.
- *
- * Returns: (transfer none): the #GdkVisual
- *
- * Since: 3.16
- */
-GdkVisual *
-gdk_gl_context_get_visual (GdkGLContext *context)
-{
-  GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
-
-  g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), NULL);
-
-  return priv->visual;
-}
-
 /*< private >
  * gdk_gl_context_end_frame:
  * @context: a #GdkGLContext
diff --git a/gdk/gdkglcontext.h b/gdk/gdkglcontext.h
index 5dbd57e..599ec99 100644
--- a/gdk/gdkglcontext.h
+++ b/gdk/gdkglcontext.h
@@ -43,8 +43,6 @@ GDK_AVAILABLE_IN_3_16
 GType gdk_gl_context_get_type (void) G_GNUC_CONST;
 
 GDK_AVAILABLE_IN_3_16
-GdkVisual *             gdk_gl_context_get_visual       (GdkGLContext *context);
-GDK_AVAILABLE_IN_3_16
 GdkWindow *             gdk_gl_context_get_window       (GdkGLContext *context);
 
 GDK_AVAILABLE_IN_3_16
diff --git a/gdk/wayland/gdkglcontext-wayland.c b/gdk/wayland/gdkglcontext-wayland.c
index ee8782d..7af884e 100644
--- a/gdk/wayland/gdkglcontext-wayland.c
+++ b/gdk/wayland/gdkglcontext-wayland.c
@@ -363,7 +363,6 @@ gdk_wayland_window_create_gl_context (GdkWindow     *window,
 
   context = g_object_new (GDK_TYPE_WAYLAND_GL_CONTEXT,
                           "window", window,
-                          "visual", gdk_window_get_visual (window),
                           "shared-context", share,
                           NULL);
 
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c
index 071f8a1..e1a578e 100644
--- a/gdk/x11/gdkglcontext-x11.c
+++ b/gdk/x11/gdkglcontext-x11.c
@@ -997,7 +997,6 @@ gdk_x11_window_create_gl_context (GdkWindow    *window,
   GdkDisplay *display;
   GdkX11GLContext *context;
   GdkVisual *visual;
-  GdkVisual *gdk_visual;
   GLXFBConfig config;
   GLXContext glx_context;
   GLXWindow drawable;
@@ -1106,9 +1105,6 @@ gdk_x11_window_create_gl_context (GdkWindow    *window,
       set_glx_drawable_info (window->impl_window, info);
     }
 
-  gdk_visual = gdk_x11_screen_lookup_visual (gdk_display_get_default_screen (display),
-                                             xvisinfo->visualid);
-
   XFree (xvisinfo);
 
   if (attached)
@@ -1123,7 +1119,6 @@ gdk_x11_window_create_gl_context (GdkWindow    *window,
 
   context = g_object_new (GDK_TYPE_X11_GL_CONTEXT,
                           "window", window,
-                          "visual", gdk_visual,
                           "shared-context", share,
                           NULL);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]