From e0d5a91286e9cf626fbccf383260d6fa53aca37b Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Fri, 17 Sep 2021 17:48:20 +0800 Subject: [PATCH] cogl/onscreen: Add function cogl_onscreen_get_pending_frame_count (cherry picked from commit bc2d423e50ba193ab402904e9e0a75cf7c32ccb7) Part-of: Signed-off-by: Mingi Sung --- cogl/cogl/cogl-onscreen-private.h | 3 +++ cogl/cogl/cogl-onscreen.c | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/cogl/cogl/cogl-onscreen-private.h b/cogl/cogl/cogl-onscreen-private.h index e732d3fd0..c7c392592 100644 --- a/cogl/cogl/cogl-onscreen-private.h +++ b/cogl/cogl/cogl-onscreen-private.h @@ -80,3 +80,6 @@ cogl_onscreen_peek_tail_frame_info (CoglOnscreen *onscreen); COGL_EXPORT CoglFrameInfo * cogl_onscreen_pop_head_frame_info (CoglOnscreen *onscreen); + +COGL_EXPORT unsigned int +cogl_onscreen_get_pending_frame_count (CoglOnscreen *onscreen); diff --git a/cogl/cogl/cogl-onscreen.c b/cogl/cogl/cogl-onscreen.c index 57aa7f0cd..b2aa95031 100644 --- a/cogl/cogl/cogl-onscreen.c +++ b/cogl/cogl/cogl-onscreen.c @@ -470,6 +470,14 @@ cogl_onscreen_pop_head_frame_info (CoglOnscreen *onscreen) return g_queue_pop_head (&priv->pending_frame_infos); } +unsigned int +cogl_onscreen_get_pending_frame_count (CoglOnscreen *onscreen) +{ + CoglOnscreenPrivate *priv = cogl_onscreen_get_instance_private (onscreen); + + return g_queue_get_length (&priv->pending_frame_infos); +} + CoglFrameClosure * cogl_onscreen_add_frame_callback (CoglOnscreen *onscreen, CoglFrameCallback callback,