mutter/clutter/clutter/clutter-frame.h
Dor Askayo 3e4a330ae7 clutter/frame-clock,wayland: Calculate frame deadline during scheduling
Calculate the frame deadline in ClutterFrameClock's
calculate_next_update_time_us() rather than in MetaWaylandCompositor's
on_after_update().

The specifics of the deadline calculation for a given frame should be
implementation detail of the frame clock and and remain internal to
allow extensibility.

This extensibility is specifically useful for scenarios where a
different deadline calculation is needed due to alternative frame
scheduling logic, such as for VRR.

No change in behavior.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3521>
2024-01-22 15:39:48 +00:00

58 lines
1.8 KiB
C

/*
* Copyright (C) 2020 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-frame-clock.h"
typedef struct _ClutterFrame ClutterFrame;
#define CLUTTER_TYPE_FRAME (clutter_frame_get_type ())
CLUTTER_EXPORT
GType clutter_frame_get_type (void);
CLUTTER_EXPORT
ClutterFrame * clutter_frame_ref (ClutterFrame *frame);
CLUTTER_EXPORT
void clutter_frame_unref (ClutterFrame *frame);
CLUTTER_EXPORT
int64_t clutter_frame_get_count (ClutterFrame *frame);
CLUTTER_EXPORT
gboolean clutter_frame_get_target_presentation_time (ClutterFrame *frame,
int64_t *target_presentation_time_us);
CLUTTER_EXPORT
gboolean clutter_frame_get_frame_deadline (ClutterFrame *frame,
int64_t *frame_deadline_us);
CLUTTER_EXPORT
void clutter_frame_set_result (ClutterFrame *frame,
ClutterFrameResult result);
CLUTTER_EXPORT
gboolean clutter_frame_has_result (ClutterFrame *frame);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterFrame, clutter_frame_unref)