mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
wlr_scene: Introduce wlr_scene_output_needs_frame
It seems that some scene compositors want to avoid wlr_scene_output_commit and use the lower lever wlr_scene_output_build_state. However, build state does not early return if a frame is not needed so compositors will implement the check themselves. Let's add a helper function that compositors can use to implement the check. Technically pending_commit_damage is a private interface, so this lets compositors not interface with private interfaces to implement the check.
This commit is contained in:
parent
2463a4723e
commit
23202e192c
2 changed files with 12 additions and 2 deletions
|
|
@ -1818,10 +1818,14 @@ static bool scene_entry_try_direct_scanout(struct render_list_entry *entry,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool wlr_scene_output_needs_frame(struct wlr_scene_output *scene_output) {
|
||||
return scene_output->output->needs_frame || pixman_region32_not_empty(
|
||||
&scene_output->pending_commit_damage);
|
||||
}
|
||||
|
||||
bool wlr_scene_output_commit(struct wlr_scene_output *scene_output,
|
||||
const struct wlr_scene_output_state_options *options) {
|
||||
if (!scene_output->output->needs_frame && !pixman_region32_not_empty(
|
||||
&scene_output->pending_commit_damage)) {
|
||||
if (!wlr_scene_output_needs_frame(scene_output)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue