[gtk+/wip/ebassi/gsk-renderer: 181/194] gsk: Remove :use-alpha from GskRenderer
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/ebassi/gsk-renderer: 181/194] gsk: Remove :use-alpha from GskRenderer
- Date: Wed, 24 Aug 2016 10:21:31 +0000 (UTC)
commit 40819aaaeb33da78d5e75b3a10b92b85381b9f71
Author: Emmanuele Bassi <ebassi gnome org>
Date: Sat Aug 13 08:36:59 2016 +0100
gsk: Remove :use-alpha from GskRenderer
It's unused, and we always assume we render with an alpha channel
enabled because it's 2016.
gsk/gskcairorenderer.c | 5 +--
gsk/gskrenderer.c | 75 ------------------------------------------------
gsk/gskrenderer.h | 5 ---
gtk/gtkwindow.c | 1 -
4 files changed, 1 insertions(+), 85 deletions(-)
---
diff --git a/gsk/gskcairorenderer.c b/gsk/gskcairorenderer.c
index 0d3591c..f889fa0 100644
--- a/gsk/gskcairorenderer.c
+++ b/gsk/gskcairorenderer.c
@@ -137,10 +137,7 @@ gsk_cairo_renderer_render (GskRenderer *renderer,
cairo_save (cr);
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
- if (gsk_renderer_get_use_alpha (renderer))
- cairo_set_source_rgba (cr, 0, 0, 0, 0);
- else
- cairo_set_source_rgb (cr, 0, 0, 0);
+ cairo_set_source_rgba (cr, 0, 0, 0, 0);
cairo_paint (cr);
cairo_restore (cr);
diff --git a/gsk/gskrenderer.c b/gsk/gskrenderer.c
index b81c9df..275ac12 100644
--- a/gsk/gskrenderer.c
+++ b/gsk/gskrenderer.c
@@ -75,7 +75,6 @@ typedef struct
gboolean is_realized : 1;
gboolean auto_clear : 1;
- gboolean use_alpha : 1;
} GskRendererPrivate;
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GskRenderer, gsk_renderer, G_TYPE_OBJECT)
@@ -83,7 +82,6 @@ G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GskRenderer, gsk_renderer, G_TYPE_OBJECT)
enum {
PROP_VIEWPORT = 1,
PROP_AUTO_CLEAR,
- PROP_USE_ALPHA,
PROP_SCALE_FACTOR,
PROP_WINDOW,
PROP_DISPLAY,
@@ -151,10 +149,6 @@ gsk_renderer_set_property (GObject *gobject,
gsk_renderer_set_auto_clear (self, g_value_get_boolean (value));
break;
- case PROP_USE_ALPHA:
- gsk_renderer_set_use_alpha (self, g_value_get_boolean (value));
- break;
-
case PROP_SCALE_FACTOR:
gsk_renderer_set_scale_factor (self, g_value_get_int (value));
break;
@@ -189,10 +183,6 @@ gsk_renderer_get_property (GObject *gobject,
g_value_set_boolean (value, priv->auto_clear);
break;
- case PROP_USE_ALPHA:
- g_value_set_boolean (value, priv->use_alpha);
- break;
-
case PROP_SCALE_FACTOR:
g_value_set_int (value, priv->scale_factor);
break;
@@ -335,22 +325,6 @@ gsk_renderer_class_init (GskRendererClass *klass)
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS);
- /**
- * GskRenderer:use-alpha:
- *
- * Whether the #GskRenderer should use the alpha channel when rendering.
- *
- * Since: 3.22
- */
- gsk_renderer_properties[PROP_USE_ALPHA] =
- g_param_spec_boolean ("use-alpha",
- "Use Alpha",
- "Whether the renderer should use the alpha channel when rendering",
- FALSE,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS |
- G_PARAM_EXPLICIT_NOTIFY);
-
g_object_class_install_properties (gobject_class, N_PROPS, gsk_renderer_properties);
}
@@ -744,55 +718,6 @@ gsk_renderer_get_auto_clear (GskRenderer *renderer)
}
/**
- * gsk_renderer_set_use_alpha:
- * @renderer: a #GskRenderer
- * @use_alpha: whether to use the alpha channel of the target surface or not
- *
- * Sets whether the @renderer should use the alpha channel of the target surface
- * or not.
- *
- * Since: 3.22
- */
-void
-gsk_renderer_set_use_alpha (GskRenderer *renderer,
- gboolean use_alpha)
-{
- GskRendererPrivate *priv = gsk_renderer_get_instance_private (renderer);
-
- g_return_if_fail (GSK_IS_RENDERER (renderer));
- g_return_if_fail (!priv->is_realized);
-
- use_alpha = !!use_alpha;
-
- if (use_alpha == priv->use_alpha)
- return;
-
- priv->use_alpha = use_alpha;
-
- g_object_notify_by_pspec (G_OBJECT (renderer), gsk_renderer_properties[PROP_USE_ALPHA]);
-}
-
-/**
- * gsk_renderer_get_use_alpha:
- * @renderer: a #GskRenderer
- *
- * Retrieves the value set using gsk_renderer_set_use_alpha().
- *
- * Returns: %TRUE if the target surface should use an alpha channel
- *
- * Since: 3.22
- */
-gboolean
-gsk_renderer_get_use_alpha (GskRenderer *renderer)
-{
- GskRendererPrivate *priv = gsk_renderer_get_instance_private (renderer);
-
- g_return_val_if_fail (GSK_IS_RENDERER (renderer), FALSE);
-
- return priv->use_alpha;
-}
-
-/**
* gsk_renderer_create_render_node:
* @renderer: a #GskRenderer
*
diff --git a/gsk/gskrenderer.h b/gsk/gskrenderer.h
index 6019539..24b7420 100644
--- a/gsk/gskrenderer.h
+++ b/gsk/gskrenderer.h
@@ -59,11 +59,6 @@ void gsk_renderer_set_auto_clear (GskRenderer
GDK_AVAILABLE_IN_3_22
gboolean gsk_renderer_get_auto_clear (GskRenderer *renderer);
GDK_AVAILABLE_IN_3_22
-void gsk_renderer_set_use_alpha (GskRenderer *renderer,
- gboolean use_alpha);
-GDK_AVAILABLE_IN_3_22
-gboolean gsk_renderer_get_use_alpha (GskRenderer *renderer);
-GDK_AVAILABLE_IN_3_22
void gsk_renderer_set_window (GskRenderer *renderer,
GdkWindow *window);
GDK_AVAILABLE_IN_3_22
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index f833c4e..34cb230 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -7287,7 +7287,6 @@ gtk_window_realize (GtkWidget *widget)
gtk_widget_set_realized (widget, TRUE);
gsk_renderer_set_window (priv->renderer, gdk_window);
- gsk_renderer_set_use_alpha (priv->renderer, TRUE);
gsk_renderer_realize (priv->renderer);
attributes.x = allocation.x;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]