[gtk+] Revert "GtkFrame: Convert to indirect rendering"
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Revert "GtkFrame: Convert to indirect rendering"
- Date: Tue, 15 Nov 2016 16:58:17 +0000 (UTC)
commit 82eb223c586d0c55c3972180e501f1628dcac0b5
Author: Benjamin Otte <otte redhat com>
Date: Tue Nov 15 16:32:30 2016 +0100
Revert "GtkFrame: Convert to indirect rendering"
This reverts commit a0b2b3745f697b91d9e91c3f10b0b3b4627a33d8.
Frames cannot be rendered by GSK yet, because they do clipping.
gtk/gtkframe.c | 61 +++++++++++++++++++++++++++++++++++++------------------
1 files changed, 41 insertions(+), 20 deletions(-)
---
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c
index de8a018..b4aed96 100644
--- a/gtk/gtkframe.c
+++ b/gtk/gtkframe.c
@@ -122,8 +122,8 @@ static void gtk_frame_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec);
-static GskRenderNode * gtk_frame_get_render_node (GtkWidget *widget,
- GskRenderer *renderer);
+static gboolean gtk_frame_draw (GtkWidget *widget,
+ cairo_t *cr);
static void gtk_frame_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_frame_remove (GtkContainer *container,
@@ -180,6 +180,13 @@ static void gtk_frame_allocate_border (GtkCssGadget *gadget,
int baseline,
GtkAllocation *out_clip,
gpointer data);
+static gboolean gtk_frame_render (GtkCssGadget *gadget,
+ cairo_t *cr,
+ int x,
+ int y,
+ int width,
+ int height,
+ gpointer data);
G_DEFINE_TYPE_WITH_CODE (GtkFrame, gtk_frame, GTK_TYPE_BIN,
@@ -242,10 +249,10 @@ gtk_frame_class_init (GtkFrameClass *class)
g_object_class_install_properties (gobject_class, LAST_PROP, frame_props);
- widget_class->get_render_node = gtk_frame_get_render_node;
- widget_class->size_allocate = gtk_frame_size_allocate;
+ widget_class->draw = gtk_frame_draw;
+ widget_class->size_allocate = gtk_frame_size_allocate;
widget_class->measure = gtk_frame_measure_;
- widget_class->state_flags_changed = gtk_frame_state_flags_changed;
+ widget_class->state_flags_changed = gtk_frame_state_flags_changed;
container_class->remove = gtk_frame_remove;
container_class->forall = gtk_frame_forall;
@@ -295,7 +302,7 @@ gtk_frame_init (GtkFrame *frame)
GTK_WIDGET (frame),
gtk_frame_measure,
gtk_frame_allocate,
- NULL,
+ gtk_frame_render,
NULL,
NULL,
NULL);
@@ -683,28 +690,42 @@ gtk_frame_get_shadow_type (GtkFrame *frame)
return frame->priv->shadow_type;
}
-static GskRenderNode *
-gtk_frame_get_render_node (GtkWidget *widget,
- GskRenderer *renderer)
+static gboolean
+gtk_frame_draw (GtkWidget *widget,
+ cairo_t *cr)
+{
+ gtk_css_gadget_draw (GTK_FRAME (widget)->priv->gadget, cr);
+
+ return FALSE;
+}
+
+static gboolean
+gtk_frame_render (GtkCssGadget *gadget,
+ cairo_t *cr,
+ int x,
+ int y,
+ int width,
+ int height,
+ gpointer data)
{
- GtkFramePrivate *priv = GTK_FRAME (widget)->priv;
+ GtkWidget *widget;
+ GtkFramePrivate *priv;
+ gint xc, yc, w, h;
GtkAllocation allocation;
- GskRenderNode *node;
- cairo_t *cr;
- int xc, yc, w, h;
- gtk_widget_get_allocation (widget, &allocation);
+ widget = gtk_css_gadget_get_owner (gadget);
+ priv = GTK_FRAME (widget)->priv;
- node = gtk_css_gadget_get_render_node (priv->gadget, renderer, FALSE);
+ cairo_save (cr);
- cr = gsk_render_node_get_draw_context (node, renderer);
+ gtk_widget_get_allocation (widget, &allocation);
/* We want to use the standard gadget drawing for the border,
* so we clip out the label allocation in order to get the
* frame gap.
*/
xc = priv->label_allocation.x - allocation.x;
- yc = allocation.y;
+ yc = y;
w = priv->label_allocation.width;
h = priv->label_allocation.height;
@@ -727,11 +748,11 @@ gtk_frame_get_render_node (GtkWidget *widget,
gtk_css_gadget_draw (priv->border_gadget, cr);
- cairo_destroy (cr);
+ cairo_restore (cr);
- gtk_container_propagate_render_node (GTK_CONTAINER (widget), renderer, node);
+ GTK_WIDGET_CLASS (gtk_frame_parent_class)->draw (widget, cr);
- return node;
+ return FALSE;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]