aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-11-26 09:52:49 +0100
committerSimon Ser <contact@emersion.fr>2022-11-26 09:52:49 +0100
commitce089498cc70ab726695e8b19ba994a00cd3beb9 (patch)
tree387e623333588dc16025ea520ee3d1b0e2ba1482
parentc02872e033b431d9f02a240abeebdf0aaa043ea6 (diff)
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.
-rw-r--r--types/scene/wlr_scene.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c
index 04fa292f..cf6eb81c 100644
--- a/types/scene/wlr_scene.c
+++ b/types/scene/wlr_scene.c
@@ -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) {