diff --git a/clutter/clutter/clutter-stage.h b/clutter/clutter/clutter-stage.h index c697e3182..36aafd0a5 100644 --- a/clutter/clutter/clutter-stage.h +++ b/clutter/clutter/clutter-stage.h @@ -119,6 +119,14 @@ typedef enum CLUTTER_FRAME_INFO_FLAG_NONE = 0, /* presentation_time timestamp was provided by the hardware */ 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; /** diff --git a/clutter/clutter/cogl/clutter-stage-cogl.c b/clutter/clutter/cogl/clutter-stage-cogl.c index 8c9c50371..5a1093430 100644 --- a/clutter/clutter/cogl/clutter-stage-cogl.c +++ b/clutter/clutter/cogl/clutter-stage-cogl.c @@ -832,6 +832,9 @@ frame_cb (CoglOnscreen *onscreen, if (cogl_frame_info_is_hw_clock (frame_info)) 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) { .frame_counter = cogl_frame_info_get_global_frame_counter (frame_info), .refresh_rate = cogl_frame_info_get_refresh_rate (frame_info),