1
0
Fork 0

onscreen/native: Add function meta_onscreen_native_discard_pending_swaps

(cherry picked from commit 06a4a06c94e832da0a2cd59da9a592e4a409e9c6)
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441>
Signed-off-by: Mingi Sung <sungmg@saltyming.net>
This commit is contained in:
Daniel van Vugt 2021-11-04 16:09:26 +08:00 committed by Mingi Sung
parent b41108f3d3
commit 472a1cc51d
Signed by: sungmg
GPG key ID: 41BAFD6FFD8036C5
2 changed files with 13 additions and 0 deletions

View file

@ -2180,6 +2180,17 @@ post_finish_frame (MetaOnscreenNative *onscreen_native,
META_KMS_UPDATE_FLAG_NONE);
}
void
meta_onscreen_native_discard_pending_swaps (CoglOnscreen *onscreen)
{
MetaOnscreenNative *onscreen_native = META_ONSCREEN_NATIVE (onscreen);
onscreen_native->swaps_pending = 0;
g_clear_pointer (&onscreen_native->superseded_frame, clutter_frame_unref);
g_clear_pointer (&onscreen_native->next_frame, clutter_frame_unref);
}
static gboolean
should_surface_be_sharable (CoglOnscreen *onscreen)
{

View file

@ -48,6 +48,8 @@ void meta_onscreen_native_dummy_power_save_page_flip (CoglOnscreen *onscreen);
gboolean meta_onscreen_native_is_buffer_scanout_compatible (CoglOnscreen *onscreen,
CoglScanout *scanout);
void meta_onscreen_native_discard_pending_swaps (CoglOnscreen *onscreen);
void meta_onscreen_native_set_view (CoglOnscreen *onscreen,
MetaRendererView *view);