[gtk+/wip/ebassi/gsk-renderer] gsk: Remove GskRenderer:auto-clear
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/ebassi/gsk-renderer] gsk: Remove GskRenderer:auto-clear
- Date: Wed, 24 Aug 2016 13:13:25 +0000 (UTC)
commit 724e2abc96344fed90f8fb68a182a22940fb197e
Author: Emmanuele Bassi <ebassi gnome org>
Date: Wed Aug 24 13:47:23 2016 +0100
gsk: Remove GskRenderer:auto-clear
We control the clearing inside each GskRenderer implementation, and we
don't allow providing a target surface any more.
gsk/gskcairorenderer.c | 15 +++------
gsk/gskrenderer.c | 84 ------------------------------------------------
gsk/gskrenderer.h | 5 ---
3 files changed, 5 insertions(+), 99 deletions(-)
---
diff --git a/gsk/gskcairorenderer.c b/gsk/gskcairorenderer.c
index f889fa0..d0766c7 100644
--- a/gsk/gskcairorenderer.c
+++ b/gsk/gskcairorenderer.c
@@ -132,16 +132,11 @@ gsk_cairo_renderer_render (GskRenderer *renderer,
gsk_renderer_get_viewport (renderer, &self->viewport);
- if (gsk_renderer_get_auto_clear (renderer))
- {
- cairo_save (cr);
- cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
-
- cairo_set_source_rgba (cr, 0, 0, 0, 0);
-
- cairo_paint (cr);
- cairo_restore (cr);
- }
+ cairo_save (cr);
+ cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
+ cairo_set_source_rgba (cr, 0, 0, 0, 0);
+ cairo_paint (cr);
+ cairo_restore (cr);
if (GSK_RENDER_MODE_CHECK (GEOMETRY))
{
diff --git a/gsk/gskrenderer.c b/gsk/gskrenderer.c
index 275ac12..323f2c1 100644
--- a/gsk/gskrenderer.c
+++ b/gsk/gskrenderer.c
@@ -74,14 +74,12 @@ typedef struct
int scale_factor;
gboolean is_realized : 1;
- gboolean auto_clear : 1;
} GskRendererPrivate;
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GskRenderer, gsk_renderer, G_TYPE_OBJECT)
enum {
PROP_VIEWPORT = 1,
- PROP_AUTO_CLEAR,
PROP_SCALE_FACTOR,
PROP_WINDOW,
PROP_DISPLAY,
@@ -145,10 +143,6 @@ gsk_renderer_set_property (GObject *gobject,
gsk_renderer_set_viewport (self, g_value_get_boxed (value));
break;
- case PROP_AUTO_CLEAR:
- gsk_renderer_set_auto_clear (self, g_value_get_boolean (value));
- break;
-
case PROP_SCALE_FACTOR:
gsk_renderer_set_scale_factor (self, g_value_get_int (value));
break;
@@ -179,10 +173,6 @@ gsk_renderer_get_property (GObject *gobject,
g_value_set_boxed (value, &priv->viewport);
break;
- case PROP_AUTO_CLEAR:
- g_value_set_boolean (value, priv->auto_clear);
- break;
-
case PROP_SCALE_FACTOR:
g_value_set_int (value, priv->scale_factor);
break;
@@ -249,26 +239,6 @@ gsk_renderer_class_init (GskRendererClass *klass)
G_PARAM_EXPLICIT_NOTIFY);
/**
- * GskRenderer:auto-clear:
- *
- * Automatically clear the rendering surface when rendering.
- *
- * Setting this property to %FALSE assumes that the owner of the
- * rendering surface will have cleared it prior to calling
- * gsk_renderer_render().
- *
- * Since: 3.22
- */
- gsk_renderer_properties[PROP_AUTO_CLEAR] =
- g_param_spec_boolean ("auto-clear",
- "Auto Clear",
- "Automatically clears the rendering target on render",
- TRUE,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS |
- G_PARAM_EXPLICIT_NOTIFY);
-
- /**
* GskRenderer:display:
*
* The #GdkDisplay used by the #GskRenderer.
@@ -335,7 +305,6 @@ gsk_renderer_init (GskRenderer *self)
priv->profiler = gsk_profiler_new ();
- priv->auto_clear = TRUE;
priv->scale_factor = 1;
}
@@ -665,59 +634,6 @@ gsk_renderer_render (GskRenderer *renderer,
}
/**
- * gsk_renderer_set_auto_clear:
- * @renderer: a #GskRenderer
- * @clear: whether the target surface should be cleared prior
- * to rendering to it
- *
- * Sets whether the target surface used by @renderer should be cleared
- * before rendering.
- *
- * If you pass a custom surface to gsk_renderer_set_surface(), you may
- * want to manage the clearing manually; this is possible by passing
- * %FALSE to this function.
- *
- * Since: 3.22
- */
-void
-gsk_renderer_set_auto_clear (GskRenderer *renderer,
- gboolean clear)
-{
- GskRendererPrivate *priv = gsk_renderer_get_instance_private (renderer);
-
- g_return_if_fail (GSK_IS_RENDERER (renderer));
-
- clear = !!clear;
-
- if (clear == priv->auto_clear)
- return;
-
- priv->auto_clear = clear;
-
- g_object_notify_by_pspec (G_OBJECT (renderer), gsk_renderer_properties[PROP_AUTO_CLEAR]);
-}
-
-/**
- * gsk_renderer_get_auto_clear:
- * @renderer: a #GskRenderer
- *
- * Retrieves the value set using gsk_renderer_set_auto_clear().
- *
- * Returns: %TRUE if the target surface should be cleared prior to rendering
- *
- * Since: 3.22
- */
-gboolean
-gsk_renderer_get_auto_clear (GskRenderer *renderer)
-{
- GskRendererPrivate *priv = gsk_renderer_get_instance_private (renderer);
-
- g_return_val_if_fail (GSK_IS_RENDERER (renderer), FALSE);
-
- return priv->auto_clear;
-}
-
-/**
* gsk_renderer_create_render_node:
* @renderer: a #GskRenderer
*
diff --git a/gsk/gskrenderer.h b/gsk/gskrenderer.h
index 24b7420..33dd958 100644
--- a/gsk/gskrenderer.h
+++ b/gsk/gskrenderer.h
@@ -54,11 +54,6 @@ void gsk_renderer_set_scale_factor (GskRenderer
GDK_AVAILABLE_IN_3_22
int gsk_renderer_get_scale_factor (GskRenderer *renderer);
GDK_AVAILABLE_IN_3_22
-void gsk_renderer_set_auto_clear (GskRenderer *renderer,
- gboolean clear);
-GDK_AVAILABLE_IN_3_22
-gboolean gsk_renderer_get_auto_clear (GskRenderer *renderer);
-GDK_AVAILABLE_IN_3_22
void gsk_renderer_set_window (GskRenderer *renderer,
GdkWindow *window);
GDK_AVAILABLE_IN_3_22
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]