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.

(cherry picked from commit 9b5f91b086b6a16c548626fed0e33f776cf3f030)
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441>
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 68061c3581
commit 287a23ace7
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, CLUTTER_FRAME_RESULT_IDLE,
} ClutterFrameResult; } 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 ()) #define CLUTTER_TYPE_FRAME_CLOCK (clutter_frame_clock_get_type ())
CLUTTER_EXPORT CLUTTER_EXPORT
G_DECLARE_FINAL_TYPE (ClutterFrameClock, clutter_frame_clock, G_DECLARE_FINAL_TYPE (ClutterFrameClock, clutter_frame_clock,

View file

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

View file

@ -115,3 +115,16 @@ clutter_frame_set_result (ClutterFrame *frame,
frame->result = result; frame->result = result;
frame->has_result = TRUE; frame->has_result = TRUE;
} }
void
clutter_frame_add_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 CLUTTER_EXPORT
gboolean clutter_frame_has_result (ClutterFrame *frame); gboolean clutter_frame_has_result (ClutterFrame *frame);
CLUTTER_EXPORT
void clutter_frame_add_hint (ClutterFrame *frame,
ClutterFrameHint hint);
CLUTTER_EXPORT
ClutterFrameHint clutter_frame_get_hints (ClutterFrame *frame);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterFrame, clutter_frame_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterFrame, clutter_frame_unref)