Revert "Convert GtkEntry to indirect rendering"

This reverts commit 3656c9f94c.

Still causes to many unresolved drawing issues.
This commit is contained in:
Matthias Clasen 2016-11-04 13:18:30 -04:00
parent 338534fb8d
commit f4fa111e32

View File

@ -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;
gtk_css_gadget_draw (GTK_ENTRY (widget)->priv->gadget, cr);
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;
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;