summaryrefslogtreecommitdiff
path: root/gdk/gdkframetimings.c
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2012-11-14 19:21:33 -0500
committerOwen W. Taylor <otaylor@fishsoup.net>2013-02-14 17:19:51 -0500
commit8855bf052d8bbbd8fdfce1cd5f4a3540661a9c8e (patch)
treea20e834ec52411ff83638d942cc4788a7fa2fb75 /gdk/gdkframetimings.c
parent9690567d5059e5667803e5b8fb438c3b97e9d7e7 (diff)
downloadgtk+-8855bf052d8bbbd8fdfce1cd5f4a3540661a9c8e.tar.gz
Add GDK_DEBUG=frames
Add a debug option to print out detailed statistics about each frame drawn. https://bugzilla.gnome.org/show_bug.cgi?id=685460
Diffstat (limited to 'gdk/gdkframetimings.c')
-rw-r--r--gdk/gdkframetimings.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/gdk/gdkframetimings.c b/gdk/gdkframetimings.c
index a51912baa6..08130015fd 100644
--- a/gdk/gdkframetimings.c
+++ b/gdk/gdkframetimings.c
@@ -30,6 +30,12 @@ struct _GdkFrameTimings
gint64 presentation_time;
gint64 refresh_interval;
+#ifdef G_ENABLE_DEBUG
+ gint64 layout_start_time;
+ gint64 paint_start_time;
+ gint64 frame_end_time;
+#endif /* G_ENABLE_DEBUG */
+
guint complete : 1;
guint slept_before : 1;
};
@@ -197,3 +203,57 @@ gdk_frame_timings_set_refresh_interval (GdkFrameTimings *timings,
timings->refresh_interval = refresh_interval;
}
+
+#ifdef G_ENABLE_DEBUG
+gint64
+_gdk_frame_timings_get_layout_start_time (GdkFrameTimings *timings)
+{
+ g_return_val_if_fail (timings != NULL, 0);
+
+ return timings->layout_start_time;
+}
+
+void
+_gdk_frame_timings_set_layout_start_time (GdkFrameTimings *timings,
+ gint64 layout_start_time)
+{
+ g_return_if_fail (timings != NULL);
+
+ timings->layout_start_time = layout_start_time;
+}
+
+gint64
+_gdk_frame_timings_get_paint_start_time (GdkFrameTimings *timings)
+{
+ g_return_val_if_fail (timings != NULL, 0);
+
+ return timings->paint_start_time;
+}
+
+void
+_gdk_frame_timings_set_paint_start_time (GdkFrameTimings *timings,
+ gint64 paint_start_time)
+{
+ g_return_if_fail (timings != NULL);
+
+ timings->paint_start_time = paint_start_time;
+}
+
+gint64
+_gdk_frame_timings_get_frame_end_time (GdkFrameTimings *timings)
+{
+ g_return_val_if_fail (timings != NULL, 0);
+
+ return timings->frame_end_time;
+}
+
+void
+_gdk_frame_timings_set_frame_end_time (GdkFrameTimings *timings,
+ gint64 frame_end_time)
+{
+ g_return_if_fail (timings != NULL);
+
+ timings->frame_end_time = frame_end_time;
+}
+
+#endif /* G_ENABLE_DEBUG */