clutter/frame-info: Add VSYNC flag

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1484>
This commit is contained in:
Ivan Molodetskikh 2021-01-30 21:14:46 +03:00 committed by Marge Bot
parent 47183a94eb
commit 02d7fca716
2 changed files with 11 additions and 0 deletions

View File

@ -127,6 +127,14 @@ typedef enum
* fullscreen surface and a surface on a hardware overlay.
*/
CLUTTER_FRAME_INFO_FLAG_ZERO_COPY = 1 << 1,
/*
* The presentation was synchronized to the "vertical retrace" by the display
* hardware such that tearing does not happen. Relying on user space
* scheduling is not acceptable for this flag. If presentation is done by a
* copy to the active frontbuffer, then it must guarantee that tearing cannot
* happen.
*/
CLUTTER_FRAME_INFO_FLAG_VSYNC = 1 << 2,
} ClutterFrameInfoFlag;
/**

View File

@ -835,6 +835,9 @@ frame_cb (CoglOnscreen *onscreen,
if (cogl_frame_info_is_zero_copy (frame_info))
flags |= CLUTTER_FRAME_INFO_FLAG_ZERO_COPY;
if (cogl_frame_info_is_vsync (frame_info))
flags |= CLUTTER_FRAME_INFO_FLAG_VSYNC;
clutter_frame_info = (ClutterFrameInfo) {
.frame_counter = cogl_frame_info_get_global_frame_counter (frame_info),
.refresh_rate = cogl_frame_info_get_refresh_rate (frame_info),