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:
parent
68061c3581
commit
287a23ace7
4 changed files with 27 additions and 0 deletions
|
@ -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,
|
||||||
|
|
|
@ -36,6 +36,7 @@ struct _ClutterFrame
|
||||||
|
|
||||||
gboolean has_result;
|
gboolean has_result;
|
||||||
ClutterFrameResult result;
|
ClutterFrameResult result;
|
||||||
|
ClutterFrameHint hints;
|
||||||
};
|
};
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue