cogl/onscreen: Add way to manually add frame infos

We will soon need to use CoglOnscreen frame events communicate cursor
plane changes; this means we need to have a way to queue them without
going through any of the current APIs that can do so, i.e. the swap
buffer functions and direct scanout.

Add a function that just adds a frame info to the queue. The one who
adds it is responsible for emitting it too.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1488>
This commit is contained in:
Jonas Ådahl 2020-10-10 00:39:53 +02:00 committed by Marge Bot
parent 88b06e39f4
commit 1c20ba4c32
2 changed files with 15 additions and 0 deletions

View File

@ -457,6 +457,14 @@ cogl_onscreen_direct_scanout (CoglOnscreen *onscreen,
return TRUE;
}
void
cogl_onscreen_add_frame_info (CoglOnscreen *onscreen,
CoglFrameInfo *info)
{
info->frame_counter = onscreen->frame_counter;
g_queue_push_tail (&onscreen->pending_frame_infos, info);
}
#ifdef COGL_HAS_X11_SUPPORT
uint32_t
cogl_x11_onscreen_get_window_xid (CoglOnscreen *onscreen)

View File

@ -304,6 +304,13 @@ cogl_onscreen_direct_scanout (CoglOnscreen *onscreen,
gpointer user_data,
GError **error);
/**
* cogl_onscreen_add_frame_info: (skip)
*/
COGL_EXPORT void
cogl_onscreen_add_frame_info (CoglOnscreen *onscreen,
CoglFrameInfo *info);
/**
* cogl_onscreen_swap_region:
* @onscreen: A #CoglOnscreen framebuffer