clutter/frame-info: Add ZERO_COPY flag

Will be used in the presentation-time Wayland protocol.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1484>
This commit is contained in:
Ivan Molodetskikh 2021-01-28 11:21:01 +03:00 committed by Marge Bot
parent 9123aa4e84
commit 93ef83a96c
2 changed files with 11 additions and 0 deletions

View File

@ -119,6 +119,14 @@ typedef enum
CLUTTER_FRAME_INFO_FLAG_NONE = 0, CLUTTER_FRAME_INFO_FLAG_NONE = 0,
/* presentation_time timestamp was provided by the hardware */ /* presentation_time timestamp was provided by the hardware */
CLUTTER_FRAME_INFO_FLAG_HW_CLOCK = 1 << 0, CLUTTER_FRAME_INFO_FLAG_HW_CLOCK = 1 << 0,
/*
* The presentation of this frame was done zero-copy. This means the buffer
* from the client was given to display hardware as is, without copying it.
* Compositing with OpenGL counts as copying, even if textured directly from
* the client buffer. Possible zero-copy cases include direct scanout of a
* fullscreen surface and a surface on a hardware overlay.
*/
CLUTTER_FRAME_INFO_FLAG_ZERO_COPY = 1 << 1,
} ClutterFrameInfoFlag; } ClutterFrameInfoFlag;
/** /**

View File

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