[gtk+/wip/ebassi/gsk-renderer: 120/126] Covert GtkOverlay to indirect rendering
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/ebassi/gsk-renderer: 120/126] Covert GtkOverlay to indirect rendering
- Date: Tue, 9 Aug 2016 16:40:50 +0000 (UTC)
commit 0dcfd78be94a10ce811d181c705efc335aa5d027
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Aug 7 00:36:24 2016 -0400
Covert GtkOverlay to indirect rendering
There is no gadget, so we use the gtk_widget_create_render_node
function for the first time here.
gtk/gtkoverlay.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c
index 0af10a5..a0f4d3f 100644
--- a/gtk/gtkoverlay.c
+++ b/gtk/gtkoverlay.c
@@ -24,6 +24,8 @@
#include "gtkbuildable.h"
#include "gtkscrolledwindow.h"
#include "gtkmarshalers.h"
+#include "gtkwidgetprivate.h"
+#include "gtkcontainerprivate.h"
#include "gtkprivate.h"
#include "gtkintl.h"
@@ -483,6 +485,20 @@ gtk_overlay_unmap (GtkWidget *widget)
GTK_WIDGET_CLASS (gtk_overlay_parent_class)->unmap (widget);
}
+static GskRenderNode *
+gtk_overlay_get_render_node (GtkWidget *widget,
+ GskRenderer *renderer)
+{
+ GskRenderNode *res = gtk_widget_create_render_node (widget, renderer, G_OBJECT_TYPE_NAME (widget));
+
+ if (res == NULL)
+ return NULL;
+
+ gtk_container_propagate_render_node (GTK_CONTAINER (widget), renderer, res);
+
+ return res;
+}
+
static void
gtk_overlay_remove (GtkContainer *container,
GtkWidget *widget)
@@ -739,7 +755,6 @@ gtk_overlay_get_child_property (GtkContainer *container,
}
}
-
static void
gtk_overlay_class_init (GtkOverlayClass *klass)
{
@@ -752,6 +767,7 @@ gtk_overlay_class_init (GtkOverlayClass *klass)
widget_class->unrealize = gtk_overlay_unrealize;
widget_class->map = gtk_overlay_map;
widget_class->unmap = gtk_overlay_unmap;
+ widget_class->get_render_node = gtk_overlay_get_render_node;
container_class->remove = gtk_overlay_remove;
container_class->forall = gtk_overlay_forall;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]