[gtk+/wip/ebassi/gsk-renderer: 96/135] GtkExpander: Convert to indirect rendering
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/ebassi/gsk-renderer: 96/135] GtkExpander: Convert to indirect rendering
- Date: Mon, 17 Oct 2016 16:29:57 +0000 (UTC)
commit 4ea6ee45678f22cee29a526dae59acdec983b169
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Aug 6 19:05:14 2016 -0400
GtkExpander: Convert to indirect rendering
This is the first example of indirect rendering involving
a box gadget. For now, we iterate the child gadgets manually,
and rely on gtk_container_propagate_render_node for the
child widgets. Eventually, we may want a better solution
here.
gtk/gtkexpander.c | 38 ++++++++++++++++++++++++++++++--------
1 files changed, 30 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index 71bc2be..3bc93a5 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -181,8 +181,8 @@ static void gtk_expander_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_expander_map (GtkWidget *widget);
static void gtk_expander_unmap (GtkWidget *widget);
-static gboolean gtk_expander_draw (GtkWidget *widget,
- cairo_t *cr);
+static GskRenderNode *gtk_expander_get_render_node (GtkWidget *widget,
+ GskRenderer *renderer);
static gboolean gtk_expander_enter_notify (GtkWidget *widget,
GdkEventCrossing *event);
@@ -271,7 +271,7 @@ gtk_expander_class_init (GtkExpanderClass *klass)
widget_class->size_allocate = gtk_expander_size_allocate;
widget_class->map = gtk_expander_map;
widget_class->unmap = gtk_expander_unmap;
- widget_class->draw = gtk_expander_draw;
+ widget_class->get_render_node = gtk_expander_get_render_node;
widget_class->enter_notify_event = gtk_expander_enter_notify;
widget_class->leave_notify_event = gtk_expander_leave_notify;
widget_class->focus = gtk_expander_focus;
@@ -675,13 +675,35 @@ gtk_expander_unmap (GtkWidget *widget)
gtk_widget_unmap (priv->label_widget);
}
-static gboolean
-gtk_expander_draw (GtkWidget *widget,
- cairo_t *cr)
+static GskRenderNode *
+gtk_expander_get_render_node (GtkWidget *widget,
+ GskRenderer *renderer)
{
- gtk_css_gadget_draw (GTK_EXPANDER (widget)->priv->gadget, cr);
+ GskRenderNode *res;
+ GskRenderNode *node;
- return FALSE;
+ res = gtk_css_gadget_get_render_node (GTK_EXPANDER (widget)->priv->gadget,
+ renderer,
+ FALSE);
+
+ if (res == NULL)
+ return NULL;
+
+ node = gtk_css_gadget_get_render_node (GTK_EXPANDER (widget)->priv->title_gadget,
+ renderer,
+ FALSE);
+ gsk_render_node_append_child (res, node);
+ gsk_render_node_unref (node);
+
+ node = gtk_css_gadget_get_render_node (GTK_EXPANDER (widget)->priv->arrow_gadget,
+ renderer,
+ FALSE);
+ gsk_render_node_append_child (res, node);
+ gsk_render_node_unref (node);
+
+ gtk_container_propagate_render_node (GTK_CONTAINER (widget), renderer, res);
+
+ return res;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]