frame-clock: Store interface pointer in variable

It's accessed a few times, so keep it around.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2795>
This commit is contained in:
Jonas Ådahl 2022-07-06 23:45:58 +02:00
parent 768ec7b0c1
commit 1c574068e0

View File

@ -690,6 +690,7 @@ static void
clutter_frame_clock_dispatch (ClutterFrameClock *frame_clock,
int64_t time_us)
{
const ClutterFrameListenerIface *iface = frame_clock->listener.iface;
int64_t frame_count;
ClutterFrameResult result;
int64_t ideal_dispatch_time_us, lateness_us;
@ -729,9 +730,9 @@ clutter_frame_clock_dispatch (ClutterFrameClock *frame_clock,
frame_count = frame_clock->frame_count++;
COGL_TRACE_BEGIN (ClutterFrameClockEvents, "Frame Clock (before frame)");
if (frame_clock->listener.iface->before_frame)
if (iface->before_frame)
{
frame_clock->listener.iface->before_frame (frame_clock,
iface->before_frame (frame_clock,
frame_count,
frame_clock->listener.user_data);
}
@ -744,7 +745,7 @@ clutter_frame_clock_dispatch (ClutterFrameClock *frame_clock,
COGL_TRACE_END (ClutterFrameClockTimelines);
COGL_TRACE_BEGIN (ClutterFrameClockFrame, "Frame Clock (frame)");
result = frame_clock->listener.iface->frame (frame_clock,
result = iface->frame (frame_clock,
frame_count,
frame_clock->listener.user_data);
COGL_TRACE_END (ClutterFrameClockFrame);