summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2021-01-30 21:14:46 +0300
committerMarge Bot <marge-bot@gnome.org>2021-03-08 09:48:11 +0000
commit02d7fca716fbeb880debd491b9c82dc4055266dc (patch)
tree62da16a2a53fbd75053ec8d1b0b1afa43d210c42
parent47183a94eb36b196212401e9e5473a8b3915ca2b (diff)
downloadmutter-02d7fca716fbeb880debd491b9c82dc4055266dc.tar.gz
clutter/frame-info: Add VSYNC flag
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1484>
-rw-r--r--clutter/clutter/clutter-stage.h8
-rw-r--r--clutter/clutter/cogl/clutter-stage-cogl.c3
2 files changed, 11 insertions, 0 deletions
diff --git a/clutter/clutter/clutter-stage.h b/clutter/clutter/clutter-stage.h
index 36aafd0a5..9f25e5472 100644
--- a/clutter/clutter/clutter-stage.h
+++ b/clutter/clutter/clutter-stage.h
@@ -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;
/**
diff --git a/clutter/clutter/cogl/clutter-stage-cogl.c b/clutter/clutter/cogl/clutter-stage-cogl.c
index 5a1093430..5e81899b0 100644
--- a/clutter/clutter/cogl/clutter-stage-cogl.c
+++ b/clutter/clutter/cogl/clutter-stage-cogl.c
@@ -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),