priv->frame_counter = -1;
priv->current = FRAME_HISTORY_MAX_LENGTH - 1;
-#ifdef G_ENABLE_DEBUG
if (fps_counter == 0)
fps_counter = gdk_profiler_define_counter ("fps", "Frames per Second");
-#endif
}
/**
void
_gdk_frame_clock_emit_flush_events (GdkFrameClock *frame_clock)
{
- guint64 before = g_get_monotonic_time ();
+ gint64 before = g_get_monotonic_time ();
g_signal_emit (frame_clock, signals[FLUSH_EVENTS], 0);
if (gdk_profiler_is_running ())
- gdk_profiler_add_mark (before * 1000,
- (g_get_monotonic_time () - before) * 1000,
- "frameclock ::flush-events", "");
+ {
+ gint64 after = g_get_monotonic_time ();
+ gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "frameclock", "flush-events");
+ }
}
void
_gdk_frame_clock_emit_before_paint (GdkFrameClock *frame_clock)
{
- guint64 before = g_get_monotonic_time ();
+ gint64 before = g_get_monotonic_time ();
g_signal_emit (frame_clock, signals[BEFORE_PAINT], 0);
if (gdk_profiler_is_running ())
- gdk_profiler_add_mark (before * 1000,
- (g_get_monotonic_time () - before) * 1000,
- "frameclock ::before-paint", "");
+ {
+ gint64 after = g_get_monotonic_time ();
+ gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "frameclock", "before-paint");
+ }
}
void
_gdk_frame_clock_emit_update (GdkFrameClock *frame_clock)
{
- guint64 before = g_get_monotonic_time ();
+ gint64 before = g_get_monotonic_time ();
g_signal_emit (frame_clock, signals[UPDATE], 0);
if (gdk_profiler_is_running ())
- gdk_profiler_add_mark (before * 1000,
- (g_get_monotonic_time () - before) * 1000,
- "frameclock ::update", "");
+ {
+ gint64 after = g_get_monotonic_time ();
+ gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "frameclock", "update");
+ }
}
void
_gdk_frame_clock_emit_layout (GdkFrameClock *frame_clock)
{
- guint64 before = g_get_monotonic_time ();
+ gint64 before = g_get_monotonic_time ();
g_signal_emit (frame_clock, signals[LAYOUT], 0);
if (gdk_profiler_is_running ())
- gdk_profiler_add_mark (before * 1000,
- (g_get_monotonic_time () - before) * 1000,
- "frameclock ::layout", "");
+ {
+ gint64 after = g_get_monotonic_time ();
+ gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "frameclock", "layout");
+ }
}
void
_gdk_frame_clock_emit_paint (GdkFrameClock *frame_clock)
{
- guint64 before = g_get_monotonic_time ();
+ gint64 before = g_get_monotonic_time ();
g_signal_emit (frame_clock, signals[PAINT], 0);
if (gdk_profiler_is_running ())
- gdk_profiler_add_mark (before * 1000,
- (g_get_monotonic_time () - before) * 1000,
- "frameclock ::paint", "");
+ {
+ gint64 after = g_get_monotonic_time ();
+ gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "frameclock", "paint");
+ }
}
void
_gdk_frame_clock_emit_after_paint (GdkFrameClock *frame_clock)
{
- guint64 before = g_get_monotonic_time ();
+ gint64 before = g_get_monotonic_time ();
g_signal_emit (frame_clock, signals[AFTER_PAINT], 0);
if (gdk_profiler_is_running ())
- gdk_profiler_add_mark (before * 1000,
- (g_get_monotonic_time () - before) * 1000,
- "frameclock ::after-paint", "");
+ {
+ gint64 after = g_get_monotonic_time ();
+ gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "frameclock", "after-paint");
+ }
}
void
_gdk_frame_clock_emit_resume_events (GdkFrameClock *frame_clock)
{
- guint64 before = g_get_monotonic_time ();
+ gint64 before = g_get_monotonic_time ();
g_signal_emit (frame_clock, signals[RESUME_EVENTS], 0);
if (gdk_profiler_is_running ())
- gdk_profiler_add_mark (before * 1000,
- (g_get_monotonic_time () - before) * 1000,
- "frameclock ::resume-events", "");
+ {
+ gint64 after = g_get_monotonic_time ();
+ gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "frameclock", "resume-events");
+ }
}
static gint64
GdkFrameTimings *timings)
{
if (timings->presentation_time != 0)
- gdk_profiler_add_mark (timings->presentation_time * 1000,
- 0,
- "presentation", "");
-
- gdk_profiler_set_counter (fps_counter,
- timings->presentation_time * 1000,
- frame_clock_get_fps (clock));
+ {
+ gdk_profiler_add_mark (timings->presentation_time * 1000, 0, "frameclock", "presentation");
+ gdk_profiler_set_counter (fps_counter,
+ timings->presentation_time * 1000,
+ frame_clock_get_fps (clock));
+ }
}