summaryrefslogtreecommitdiff
path: root/gtk/gtkcssprovider.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2020-02-12 11:05:01 +0100
committerAlexander Larsson <alexl@redhat.com>2020-02-12 11:05:01 +0100
commit01d5ad2056f9c896246219eb04ca1ae807a45768 (patch)
treeaecc056b7dd2c2e0911c223fada8ca4e06dfceb3 /gtk/gtkcssprovider.c
parentcc643df88b541b7505885ecff02c8576decf6bbd (diff)
downloadgtk+-01d5ad2056f9c896246219eb04ca1ae807a45768.tar.gz
profiler: Make profiler-is-running a macro
When we use if (GDK_PROFILER_IS_RUNNING) this means we get an inlined if (FALSE) when the compiler support is not compiled in, which gets rid of all the related code completely. We also expand to G_UNLIKELY(gdk_profiler_is_running ()) in the supported case which might cause somewhat better code generation.
Diffstat (limited to 'gtk/gtkcssprovider.c')
-rw-r--r--gtk/gtkcssprovider.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 986d38a40d..3747b35076 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -1009,7 +1009,7 @@ gtk_css_provider_postprocess (GtkCssProvider *css_provider)
}
#endif
- if (gdk_profiler_is_running ())
+ if (GDK_PROFILER_IS_RUNNING)
gdk_profiler_add_mark (before, (g_get_monotonic_time () - before), "create selector tree", NULL);
}
@@ -1068,7 +1068,7 @@ gtk_css_provider_load_internal (GtkCssProvider *self,
g_bytes_unref (bytes);
}
- if (gdk_profiler_is_running ())
+ if (GDK_PROFILER_IS_RUNNING)
{
char *uri = g_file_get_uri (file);
gdk_profiler_add_mark (before, (g_get_monotonic_time () - before), "theme load", uri);