mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-13 08:22:16 -04:00
scene: Add wlr_scene_output_set_frame_scheduler
This allows the compositor to replace frame schedulers for a given scene output at runtime.
This commit is contained in:
parent
d99ee40a1d
commit
d560a30adc
2 changed files with 16 additions and 0 deletions
|
|
@ -592,6 +592,13 @@ void wlr_scene_output_destroy(struct wlr_scene_output *scene_output);
|
|||
*/
|
||||
void wlr_scene_output_set_position(struct wlr_scene_output *scene_output,
|
||||
int lx, int ly);
|
||||
/**
|
||||
* Replace the frame scheduler for this scene output, destroying the previous
|
||||
* scheduler. If scene output currently needs a new frame, a frame will be
|
||||
* scheduled on the new frame scheduler.
|
||||
*/
|
||||
void wlr_scene_output_set_frame_scheduler(struct wlr_scene_output *scene_output,
|
||||
struct wlr_frame_scheduler *scheduler);
|
||||
|
||||
struct wlr_scene_output_state_options {
|
||||
struct wlr_scene_timer *timer;
|
||||
|
|
|
|||
|
|
@ -1790,6 +1790,15 @@ static void highlight_region_destroy(struct highlight_region *damage) {
|
|||
free(damage);
|
||||
}
|
||||
|
||||
void wlr_scene_output_set_frame_scheduler(struct wlr_scene_output *scene_output,
|
||||
struct wlr_frame_scheduler *scheduler) {
|
||||
wlr_frame_scheduler_destroy(scene_output->frame_scheduler);
|
||||
scene_output->frame_scheduler = scheduler;
|
||||
if (wlr_scene_output_needs_frame(scene_output)) {
|
||||
wlr_frame_scheduler_schedule_frame(scheduler);
|
||||
}
|
||||
}
|
||||
|
||||
void wlr_scene_output_destroy(struct wlr_scene_output *scene_output) {
|
||||
if (scene_output == NULL) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue