[gtk+] Drop some redundant cairo_save calls
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Drop some redundant cairo_save calls
- Date: Tue, 29 Sep 2015 13:44:01 +0000 (UTC)
commit 12be4b04f81feb6ec3d69813478e0e61a2a90baa
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Sep 28 15:08:26 2015 -0400
Drop some redundant cairo_save calls
Almost all callers of _gtk_widget_draw already did their own
cairo_save/restore, so drop the save/restore calls inside
_gtk_widget_draw and instead fix the last caller, gtk_widget_draw,
to do the same.
gtk/gtkwidget.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 050bbfe..ab5f461 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -6990,8 +6990,6 @@ _gtk_widget_draw (GtkWidget *widget,
* the window hierarchy.
*/
- cairo_save (cr);
-
push_group =
widget->priv->alpha != 255 &&
(!_gtk_widget_is_toplevel (widget) ||
@@ -7049,8 +7047,6 @@ _gtk_widget_draw (GtkWidget *widget,
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
cairo_paint_with_alpha (cr, widget->priv->alpha / 255.0);
}
-
- cairo_restore (cr);
}
@@ -7088,7 +7084,9 @@ gtk_widget_draw (GtkWidget *widget,
g_return_if_fail (!widget->priv->alloc_needed);
g_return_if_fail (cr != NULL);
+ cairo_save (cr);
_gtk_widget_draw (widget, cr);
+ cairo_restore (cr);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]