mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 12:32:05 +00:00
onscreen/native: Send a symbolic flip on discard
Now that symbolic flips were introduced, it makes more sense to use them instead of emitting a fake page flip. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1484>
This commit is contained in:
parent
02d7fca716
commit
f02f17808a
@ -337,11 +337,14 @@ page_flip_feedback_discarded (MetaKmsCrtc *kms_crtc,
|
|||||||
const GError *error)
|
const GError *error)
|
||||||
{
|
{
|
||||||
MetaRendererView *view = user_data;
|
MetaRendererView *view = user_data;
|
||||||
int64_t now_us;
|
CoglFramebuffer *framebuffer =
|
||||||
|
clutter_stage_view_get_onscreen (CLUTTER_STAGE_VIEW (view));
|
||||||
|
CoglOnscreen *onscreen = COGL_ONSCREEN (framebuffer);
|
||||||
|
CoglFrameInfo *frame_info;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Page flipping failed, but we want to fail gracefully, so to avoid freezing
|
* Page flipping failed, but we want to fail gracefully, so to avoid freezing
|
||||||
* the frame clack, pretend we flipped.
|
* the frame clock, emit a symbolic flip.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (error &&
|
if (error &&
|
||||||
@ -350,13 +353,10 @@ page_flip_feedback_discarded (MetaKmsCrtc *kms_crtc,
|
|||||||
G_IO_ERROR_PERMISSION_DENIED))
|
G_IO_ERROR_PERMISSION_DENIED))
|
||||||
g_warning ("Page flip discarded: %s", error->message);
|
g_warning ("Page flip discarded: %s", error->message);
|
||||||
|
|
||||||
now_us = g_get_monotonic_time ();
|
frame_info = cogl_onscreen_peek_head_frame_info (onscreen);
|
||||||
|
frame_info->flags |= COGL_FRAME_INFO_FLAG_SYMBOLIC;
|
||||||
|
|
||||||
notify_view_crtc_presented (view,
|
meta_onscreen_native_notify_frame_complete (onscreen);
|
||||||
kms_crtc,
|
|
||||||
now_us,
|
|
||||||
COGL_FRAME_INFO_FLAG_NONE,
|
|
||||||
0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const MetaKmsPageFlipListenerVtable page_flip_listener_vtable = {
|
static const MetaKmsPageFlipListenerVtable page_flip_listener_vtable = {
|
||||||
|
Loading…
Reference in New Issue
Block a user