1
0
Fork 0

clutter/frame: Add ClutterFrameHint to ClutterFrame

This will allow the backend to provide performance hints to the frame
clock in future.

Signed-off-by: Mingi Sung <sungmg@saltyming.net>
This commit is contained in:
Daniel van Vugt 2021-09-07 19:08:15 +08:00 committed by Mingi Sung
parent a1e6d2242b
commit fcea00f63a
Signed by: sungmg
GPG key ID: 41BAFD6FFD8036C5
4 changed files with 27 additions and 0 deletions

View file

@ -33,6 +33,12 @@ typedef enum _ClutterFrameResult
CLUTTER_FRAME_RESULT_IDLE,
} ClutterFrameResult;
typedef enum _ClutterFrameHint
{
CLUTTER_FRAME_HINT_NONE = 0,
CLUTTER_FRAME_HINT_DIRECT_SCANOUT_ATTEMPTED = 1 << 0,
} ClutterFrameHint;
#define CLUTTER_TYPE_FRAME_CLOCK (clutter_frame_clock_get_type ())
CLUTTER_EXPORT
G_DECLARE_FINAL_TYPE (ClutterFrameClock, clutter_frame_clock,

View file

@ -36,6 +36,7 @@ struct _ClutterFrame
gboolean has_result;
ClutterFrameResult result;
ClutterFrameHint hints;
};
CLUTTER_EXPORT

View file

@ -115,3 +115,16 @@ clutter_frame_set_result (ClutterFrame *frame,
frame->result = result;
frame->has_result = TRUE;
}
void
clutter_frame_set_hint (ClutterFrame *frame,
ClutterFrameHint hint)
{
frame->hints |= hint;
}
ClutterFrameHint
clutter_frame_get_hints (ClutterFrame *frame)
{
return frame->hints;
}

View file

@ -54,4 +54,11 @@ void clutter_frame_set_result (ClutterFrame *frame,
CLUTTER_EXPORT
gboolean clutter_frame_has_result (ClutterFrame *frame);
CLUTTER_EXPORT
void clutter_frame_set_hint (ClutterFrame *frame,
ClutterFrameHint hint);
CLUTTER_EXPORT
ClutterFrameHint clutter_frame_get_hints (ClutterFrame *frame);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterFrame, clutter_frame_unref)