mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
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.
This commit is contained in:
parent
ad30262fef
commit
f0ae8da993
@ -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
|
||||
|
@ -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;
|
||||
@ -220,22 +203,6 @@ gdk_gl_context_class_init (GdkGLContextClass *klass)
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
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:
|
||||
*
|
||||
@ -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
|
||||
|
@ -42,8 +42,6 @@ GQuark gdk_gl_error_quark (void);
|
||||
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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user