[gtk+] Revert "Convert GtkEntry to indirect rendering"
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Revert "Convert GtkEntry to indirect rendering"
- Date: Fri, 4 Nov 2016 17:23:14 +0000 (UTC)
commit f4fa111e3240822df1b1c02abc49fea9c274232c
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Nov 4 13:18:30 2016 -0400
Revert "Convert GtkEntry to indirect rendering"
This reverts commit 3656c9f94c0401376d3dc0a3963312ef986cb021.
Still causes to many unresolved drawing issues.
gtk/gtkentry.c | 53 ++++++++++++++++++++++-------------------------------
1 files changed, 22 insertions(+), 31 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index dd5b93c..2f91597 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -414,8 +414,8 @@ static void gtk_entry_map (GtkWidget *widget);
static void gtk_entry_unmap (GtkWidget *widget);
static void gtk_entry_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
-static GskRenderNode *gtk_entry_get_render_node (GtkWidget *widget,
- GskRenderer *renderer);
+static gint gtk_entry_draw (GtkWidget *widget,
+ cairo_t *cr);
static gboolean gtk_entry_event (GtkWidget *widget,
GdkEvent *event);
static gint gtk_entry_enter_notify (GtkWidget *widget,
@@ -761,7 +761,7 @@ gtk_entry_class_init (GtkEntryClass *class)
widget_class->unrealize = gtk_entry_unrealize;
widget_class->measure = gtk_entry_measure_;
widget_class->size_allocate = gtk_entry_size_allocate;
- widget_class->get_render_node = gtk_entry_get_render_node;
+ widget_class->draw = gtk_entry_draw;
widget_class->enter_notify_event = gtk_entry_enter_notify;
widget_class->leave_notify_event = gtk_entry_leave_notify;
widget_class->event = gtk_entry_event;
@@ -3591,36 +3591,13 @@ should_prelight (GtkEntry *entry,
return TRUE;
}
-static GskRenderNode *
-gtk_entry_get_render_node (GtkWidget *widget,
- GskRenderer *renderer)
+static gboolean
+gtk_entry_draw (GtkWidget *widget,
+ cairo_t *cr)
{
- GtkEntryPrivate *priv = GTK_ENTRY (widget)->priv;
- GskRenderNode *res, *node;
- int i;
-
- res = gtk_css_gadget_get_render_node (priv->gadget, renderer, FALSE);
-
- for (i = 0; i < MAX_ICONS; i++)
- {
- EntryIconInfo *icon_info = priv->icons[i];
-
- if (icon_info == NULL)
- continue;
+ gtk_css_gadget_draw (GTK_ENTRY (widget)->priv->gadget, cr);
- node = gtk_css_gadget_get_render_node (icon_info->gadget, renderer, FALSE);
- gsk_render_node_append_child (res, node);
- gsk_render_node_unref (node);
- }
-
- if (priv->progress_gadget && gtk_css_gadget_get_visible (priv->progress_gadget))
- {
- node = gtk_css_gadget_get_render_node (priv->progress_gadget, renderer, FALSE);
- gsk_render_node_append_child (res, node);
- gsk_render_node_unref (node);
- }
-
- return res;
+ return GDK_EVENT_PROPAGATE;
}
#define UNDERSHOOT_SIZE 20
@@ -3696,11 +3673,16 @@ gtk_entry_render (GtkCssGadget *gadget,
GtkWidget *widget;
GtkEntry *entry;
GtkEntryPrivate *priv;
+ int i;
widget = gtk_css_gadget_get_owner (gadget);
entry = GTK_ENTRY (widget);
priv = entry->priv;
+ /* Draw progress */
+ if (priv->progress_gadget && gtk_css_gadget_get_visible (priv->progress_gadget))
+ gtk_css_gadget_draw (priv->progress_gadget, cr);
+
/* Draw text and cursor */
cairo_save (cr);
@@ -3717,6 +3699,15 @@ gtk_entry_render (GtkCssGadget *gadget,
cairo_restore (cr);
+ /* Draw icons */
+ for (i = 0; i < MAX_ICONS; i++)
+ {
+ EntryIconInfo *icon_info = priv->icons[i];
+
+ if (icon_info != NULL)
+ gtk_css_gadget_draw (icon_info->gadget, cr);
+ }
+
gtk_entry_draw_undershoot (entry, cr);
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]