mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-13 08:22:16 -04:00
scene: Deprecate wlr_scene_output_needs_frame
Previously, needs_frame was only set specifically when a non-damaging update was required, and would only be cleared when the backend committed the frame. Under the new frame scheduler, needs_frame is always set when a frame is scheduled, with effectively a single scheduling path for all change sources, and needs_frame must have been true for a frame to be emitted. Drop wlr_scene_output_needs_frame to make it clear that such a check is no longer meaningful.
This commit is contained in:
parent
d560a30adc
commit
411a3e6a6e
2 changed files with 2 additions and 17 deletions
|
|
@ -617,12 +617,6 @@ struct wlr_scene_output_state_options {
|
|||
struct wlr_swapchain *swapchain;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if scene wants to render a new frame. False, if no new frame
|
||||
* is needed and an output commit can be skipped for the current frame.
|
||||
*/
|
||||
bool wlr_scene_output_needs_frame(struct wlr_scene_output *scene_output);
|
||||
|
||||
/**
|
||||
* Render and commit an output.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1792,9 +1792,10 @@ static void highlight_region_destroy(struct highlight_region *damage) {
|
|||
|
||||
void wlr_scene_output_set_frame_scheduler(struct wlr_scene_output *scene_output,
|
||||
struct wlr_frame_scheduler *scheduler) {
|
||||
bool needs_frame = scene_output->frame_scheduler->needs_frame;
|
||||
wlr_frame_scheduler_destroy(scene_output->frame_scheduler);
|
||||
scene_output->frame_scheduler = scheduler;
|
||||
if (wlr_scene_output_needs_frame(scene_output)) {
|
||||
if (needs_frame) {
|
||||
wlr_frame_scheduler_schedule_frame(scheduler);
|
||||
}
|
||||
}
|
||||
|
|
@ -2152,18 +2153,8 @@ static enum scene_direct_scanout_result scene_entry_try_direct_scanout(
|
|||
return SCANOUT_SUCCESS;
|
||||
}
|
||||
|
||||
bool wlr_scene_output_needs_frame(struct wlr_scene_output *scene_output) {
|
||||
return scene_output->frame_scheduler->needs_frame ||
|
||||
!pixman_region32_empty(&scene_output->pending_commit_damage) ||
|
||||
scene_output->gamma_lut_changed;
|
||||
}
|
||||
|
||||
bool wlr_scene_output_commit(struct wlr_scene_output *scene_output,
|
||||
const struct wlr_scene_output_state_options *options) {
|
||||
if (!wlr_scene_output_needs_frame(scene_output)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ok = false;
|
||||
struct wlr_output_state state;
|
||||
wlr_output_state_init(&state);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue