[gtk+/gtk-3-20] css gadget: Don't get display flags twice
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-20] css gadget: Don't get display flags twice
- Date: Thu, 5 May 2016 19:19:42 +0000 (UTC)
commit 11e8573d0ec9d51284999c9f45ebb2edc7605434
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Apr 19 23:23:18 2016 -0400
css gadget: Don't get display flags twice
This got more expensive now that we store them per-display,
so don't get them twice in the same function.
gtk/gtkcssgadget.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcssgadget.c b/gtk/gtkcssgadget.c
index 8e5ceca..5e0102c 100644
--- a/gtk/gtkcssgadget.c
+++ b/gtk/gtkcssgadget.c
@@ -890,7 +890,8 @@ gtk_css_gadget_draw (GtkCssGadget *gadget,
#if G_ENABLE_DEBUG
{
GdkDisplay *display = gtk_widget_get_display (gtk_css_gadget_get_owner (gadget));
- if (GTK_DISPLAY_DEBUG_CHECK (display, LAYOUT))
+ GtkDebugFlag flags = gtk_get_display_debug_flags (display);
+ if G_UNLIKELY (flags & GTK_DEBUG_LAYOUT)
{
cairo_save (cr);
cairo_new_path (cr);
@@ -912,7 +913,7 @@ gtk_css_gadget_draw (GtkCssGadget *gadget,
cairo_stroke (cr);
cairo_restore (cr);
}
- if (GTK_DISPLAY_DEBUG_CHECK (display, BASELINES))
+ if G_UNLIKELY (flags & GTK_DEBUG_BASELINES)
{
int baseline = priv->allocated_baseline;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]