diff options
author | Benjamin Otte <otte@redhat.com> | 2021-07-10 03:24:00 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2021-07-22 16:27:31 +0200 |
commit | 2c987861a6d96e12e2037343444ee8f6f4570229 (patch) | |
tree | 4859e0a479adc6cd9ceefaf9177eb8f46ad69c2f /gdk/gdkglcontext.c | |
parent | c7320df0c906d927b542d6739fd4c19fe3191335 (diff) | |
download | gtk+-2c987861a6d96e12e2037343444ee8f6f4570229.tar.gz |
gl: Deprecate gdk_gl_context_get_shared_context()
It's not used anymore. And in particular we do want to keep the display
context private, so we're not gonna return it from this function.
Diffstat (limited to 'gdk/gdkglcontext.c')
-rw-r--r-- | gdk/gdkglcontext.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c index 6681b44648..ed6fb577d2 100644 --- a/gdk/gdkglcontext.c +++ b/gdk/gdkglcontext.c @@ -89,8 +89,6 @@ #include <epoxy/gl.h> typedef struct { - GdkGLContext *shared_context; - int major; int minor; int gl_version; @@ -144,7 +142,6 @@ static void gdk_gl_context_dispose (GObject *gobject) { GdkGLContext *context = GDK_GL_CONTEXT (gobject); - GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context); GdkGLContext *current; gdk_gl_context_clear_old_updated_area (context); @@ -153,8 +150,6 @@ gdk_gl_context_dispose (GObject *gobject) if (current == context) g_private_replace (&thread_current_context, NULL); - g_clear_object (&priv->shared_context); - G_OBJECT_CLASS (gdk_gl_context_parent_class)->dispose (gobject); } @@ -174,17 +169,10 @@ gdk_gl_context_set_property (GObject *gobject, const GValue *value, GParamSpec *pspec) { - GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private ((GdkGLContext *) gobject); - switch (prop_id) { case PROP_SHARED_CONTEXT: - { - GdkGLContext *context = g_value_get_object (value); - - if (context != NULL) - priv->shared_context = g_object_ref (context); - } + g_assert (g_value_get_object (value) == NULL); break; default: @@ -198,12 +186,10 @@ gdk_gl_context_get_property (GObject *gobject, GValue *value, GParamSpec *pspec) { - GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private ((GdkGLContext *) gobject); - switch (prop_id) { case PROP_SHARED_CONTEXT: - g_value_set_object (value, priv->shared_context); + g_value_set_object (value, NULL); break; default: @@ -427,7 +413,13 @@ gdk_gl_context_class_init (GdkGLContextClass *klass) /** * GdkGLContext:shared-context: (attributes org.gtk.Property.get=gdk_gl_context_get_shared_context) * - * The `GdkGLContext` that this context is sharing data with, or %NULL + * Always %NULL + * + * As many contexts can share data now and no single shared context exists + * anymore, this function has been deprecated and now always returns %NULL. + * + * Deprecated: 4.4: Use [method@Gdk.GLContext.is_shared] to check if contexts + * can be shared. */ obj_pspecs[PROP_SHARED_CONTEXT] = g_param_spec_object ("shared-context", @@ -436,7 +428,8 @@ gdk_gl_context_class_init (GdkGLContextClass *klass) GDK_TYPE_GL_CONTEXT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | - G_PARAM_STATIC_STRINGS); + G_PARAM_STATIC_STRINGS | + G_PARAM_DEPRECATED); gobject_class->set_property = gdk_gl_context_set_property; gobject_class->get_property = gdk_gl_context_get_property; @@ -1206,18 +1199,22 @@ gdk_gl_context_get_surface (GdkGLContext *context) * gdk_gl_context_get_shared_context: (attributes org.gtk.Method.get_property=shared-context) * @context: a `GdkGLContext` * - * Retrieves the `GdkGLContext` that this @context share data with. + * Used to retrieves the `GdkGLContext` that this @context share data with. + * + * As many contexts can share data now and no single shared context exists + * anymore, this function has been deprecated and now always returns %NULL. * - * Returns: (nullable) (transfer none): a `GdkGLContext` + * Returns: (nullable) (transfer none): %NULL + * + * Deprecated: 4.4: Use [method@Gdk.GLContext.is_shared] to check if contexts + * can be shared. */ GdkGLContext * gdk_gl_context_get_shared_context (GdkGLContext *context) { - GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context); - g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), NULL); - return priv->shared_context; + return NULL; } /** |