From: Matthias Clasen Date: Tue, 4 Feb 2020 22:07:43 +0000 (+0100) Subject: frameclock: cosmetics X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~20^2~98 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9a446f2041a3ec2555a4c9e5889f5a496a9f265a;p=gtk4.git frameclock: cosmetics Redo the profiler marks for the frame clock signals to look more uniform. --- diff --git a/gdk/gdkframeclock.c b/gdk/gdkframeclock.c index db16c7653e..272edbe4f6 100644 --- a/gdk/gdkframeclock.c +++ b/gdk/gdkframeclock.c @@ -261,10 +261,8 @@ gdk_frame_clock_init (GdkFrameClock *clock) 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 } /** @@ -649,92 +647,99 @@ gdk_frame_clock_get_refresh_info (GdkFrameClock *frame_clock, 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 @@ -812,11 +817,10 @@ _gdk_frame_clock_add_timings_to_profiler (GdkFrameClock *clock, 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)); + } }