summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-01-17 09:22:01 -0500
committerMatthias Clasen <mclasen@redhat.com>2018-01-17 12:01:25 -0500
commitf3927f1155f0a50ea33407f5c04c78005b610c84 (patch)
tree3453b7ac8fbd7e7650d63ba31c5cfecaa3dbfade
parent5711fb9b26dbf516e74de34527d77dad2a64c4d5 (diff)
downloadgtk+-f3927f1155f0a50ea33407f5c04c78005b610c84.tar.gz
Drop GtkGLArea::has-alpha
We now always behave as if has-alpha is TRUE. Update all callers.
-rw-r--r--gtk/gtkglarea.c85
-rw-r--r--gtk/gtkglarea.h5
-rw-r--r--tests/gdkgears.c15
-rw-r--r--tests/testglblending.c12
4 files changed, 0 insertions, 117 deletions
diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c
index 7a1c17414c..d93edd0c01 100644
--- a/gtk/gtkglarea.c
+++ b/gtk/gtkglarea.c
@@ -154,7 +154,6 @@ typedef struct {
guint texture;
guint depth_stencil_buffer;
- gboolean has_alpha;
gboolean has_depth_buffer;
gboolean has_stencil_buffer;
@@ -168,7 +167,6 @@ enum {
PROP_0,
PROP_CONTEXT,
- PROP_HAS_ALPHA,
PROP_HAS_DEPTH_BUFFER,
PROP_HAS_STENCIL_BUFFER,
PROP_USE_ES,
@@ -219,10 +217,6 @@ gtk_gl_area_set_property (GObject *gobject,
gtk_gl_area_set_auto_render (self, g_value_get_boolean (value));
break;
- case PROP_HAS_ALPHA:
- gtk_gl_area_set_has_alpha (self, g_value_get_boolean (value));
- break;
-
case PROP_HAS_DEPTH_BUFFER:
gtk_gl_area_set_has_depth_buffer (self, g_value_get_boolean (value));
break;
@@ -254,10 +248,6 @@ gtk_gl_area_get_property (GObject *gobject,
g_value_set_boolean (value, priv->auto_render);
break;
- case PROP_HAS_ALPHA:
- g_value_set_boolean (value, priv->has_alpha);
- break;
-
case PROP_HAS_DEPTH_BUFFER:
g_value_set_boolean (value, priv->has_depth_buffer);
break;
@@ -733,27 +723,6 @@ gtk_gl_area_class_init (GtkGLAreaClass *klass)
G_PARAM_EXPLICIT_NOTIFY);
/**
- * GtkGLArea:has-alpha:
- *
- * If set to %TRUE the buffer allocated by the widget will have an alpha channel
- * component, and when rendering to the window the result will be composited over
- * whatever is below the widget.
- *
- * If set to %FALSE there will be no alpha channel, and the buffer will fully
- * replace anything below the widget.
- *
- * Since: 3.16
- */
- obj_props[PROP_HAS_ALPHA] =
- g_param_spec_boolean ("has-alpha",
- P_("Has alpha"),
- P_("Whether the color buffer has an alpha component"),
- FALSE,
- GTK_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS |
- G_PARAM_EXPLICIT_NOTIFY);
-
- /**
* GtkGLArea:has-depth-buffer:
*
* If set to %TRUE the widget will allocate and enable a depth buffer for the
@@ -1072,60 +1041,6 @@ gtk_gl_area_get_required_version (GtkGLArea *area,
}
/**
- * gtk_gl_area_get_has_alpha:
- * @area: a #GtkGLArea
- *
- * Returns whether the area has an alpha component.
- *
- * Returns: %TRUE if the @area has an alpha component, %FALSE otherwise
- *
- * Since: 3.16
- */
-gboolean
-gtk_gl_area_get_has_alpha (GtkGLArea *area)
-{
- GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
-
- g_return_val_if_fail (GTK_IS_GL_AREA (area), FALSE);
-
- return priv->has_alpha;
-}
-
-/**
- * gtk_gl_area_set_has_alpha:
- * @area: a #GtkGLArea
- * @has_alpha: %TRUE to add an alpha component
- *
- * If @has_alpha is %TRUE the buffer allocated by the widget will have
- * an alpha channel component, and when rendering to the window the
- * result will be composited over whatever is below the widget.
- *
- * If @has_alpha is %FALSE there will be no alpha channel, and the
- * buffer will fully replace anything below the widget.
- *
- * Since: 3.16
- */
-void
-gtk_gl_area_set_has_alpha (GtkGLArea *area,
- gboolean has_alpha)
-{
- GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
-
- g_return_if_fail (GTK_IS_GL_AREA (area));
-
- has_alpha = !!has_alpha;
-
- if (priv->has_alpha != has_alpha)
- {
- priv->has_alpha = has_alpha;
-
- g_object_notify (G_OBJECT (area), "has-alpha");
-
- gtk_gl_area_delete_buffers (area);
- }
-}
-
-/**
* gtk_gl_area_get_has_depth_buffer:
* @area: a #GtkGLArea
*
diff --git a/gtk/gtkglarea.h b/gtk/gtkglarea.h
index d769a64eb0..59d30be138 100644
--- a/gtk/gtkglarea.h
+++ b/gtk/gtkglarea.h
@@ -99,11 +99,6 @@ void gtk_gl_area_get_required_version (GtkGLArea *area,
gint *major,
gint *minor);
GDK_AVAILABLE_IN_3_16
-gboolean gtk_gl_area_get_has_alpha (GtkGLArea *area);
-GDK_AVAILABLE_IN_3_16
-void gtk_gl_area_set_has_alpha (GtkGLArea *area,
- gboolean has_alpha);
-GDK_AVAILABLE_IN_3_16
gboolean gtk_gl_area_get_has_depth_buffer (GtkGLArea *area);
GDK_AVAILABLE_IN_3_16
void gtk_gl_area_set_has_depth_buffer (GtkGLArea *area,
diff --git a/tests/gdkgears.c b/tests/gdkgears.c
index 94002d5adf..65c4f12fb1 100644
--- a/tests/gdkgears.c
+++ b/tests/gdkgears.c
@@ -8,14 +8,6 @@
************************************************************************/
static void
-toggle_alpha (GtkWidget *checkbutton,
- GtkWidget *gears)
-{
- gtk_gl_area_set_has_alpha (GTK_GL_AREA (gears),
- gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(checkbutton)));
-}
-
-static void
toggle_overlay (GtkWidget *checkbutton,
GtkWidget *revealer)
{
@@ -187,13 +179,6 @@ main (int argc, char *argv[])
g_signal_connect (check, "toggled",
G_CALLBACK (toggle_spin), spinner);
- check = gtk_check_button_new_with_label ("Alpha");
- gtk_box_pack_end (GTK_BOX (hbox), check);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), FALSE);
- gtk_widget_show (check);
- g_signal_connect (check, "toggled",
- G_CALLBACK (toggle_alpha), gears);
-
check = gtk_check_button_new_with_label ("Overlay");
gtk_box_pack_end (GTK_BOX (hbox), check);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), FALSE);
diff --git a/tests/testglblending.c b/tests/testglblending.c
index 25991c3c6a..fea7115582 100644
--- a/tests/testglblending.c
+++ b/tests/testglblending.c
@@ -38,12 +38,6 @@ main (int argc, char *argv[])
gtk_widget_set_size_request (gears, 70, 50);
gtk_fixed_put (GTK_FIXED (fixed), gears, 60, 100);
- gears = gtk_gears_new ();
- gtk_gl_area_set_has_alpha (GTK_GL_AREA (gears), TRUE);
- gtk_widget_set_size_request (gears, 70, 50);
- gtk_fixed_put (GTK_FIXED (fixed), gears, 120, 100);
-
-
spinner = gtk_spinner_new ();
gtk_spinner_start (GTK_SPINNER (spinner));
gtk_widget_set_size_request (spinner, 50, 50);
@@ -64,12 +58,6 @@ main (int argc, char *argv[])
gtk_widget_set_size_request (gears, 70, 50);
gtk_fixed_put (GTK_FIXED (fixed), gears, 60, 130);
- gears = gtk_gears_new ();
- gtk_gl_area_set_has_alpha (GTK_GL_AREA (gears), TRUE);
- gtk_widget_set_size_request (gears, 70, 50);
- gtk_fixed_put (GTK_FIXED (fixed), gears, 120, 130);
-
-
spinner = gtk_spinner_new ();
gtk_spinner_start (GTK_SPINNER (spinner));
gtk_widget_set_size_request (spinner, 50, 50);