mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-26 06:35:58 +01:00
scene: use wlr_output_state for direct scanout
Avoids polluting wlr_output.pending with temporary state. Removes the need to call wlr_output_rollback() in error codepaths.
This commit is contained in:
parent
c02872e033
commit
ce089498cc
1 changed files with 7 additions and 4 deletions
|
@ -1424,13 +1424,16 @@ static bool scene_node_try_direct_scanout(struct wlr_scene_node *node,
|
|||
return false;
|
||||
}
|
||||
|
||||
wlr_output_attach_buffer(output, buffer->buffer);
|
||||
if (!wlr_output_test(output)) {
|
||||
wlr_output_rollback(output);
|
||||
struct wlr_output_state state = {
|
||||
.committed = WLR_OUTPUT_STATE_BUFFER,
|
||||
.buffer = buffer->buffer,
|
||||
};
|
||||
|
||||
if (!wlr_output_test_state(output, &state)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return wlr_output_commit(output);
|
||||
return wlr_output_commit_state(output, &state);
|
||||
}
|
||||
|
||||
bool wlr_scene_output_commit(struct wlr_scene_output *scene_output) {
|
||||
|
|
Loading…
Reference in a new issue