mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-10-29 23:20:57 +00:00
output/render: Drop buffer age from wlr_output_begin_render_pass
For compositors wanting to damage track, `wlr_damage_ring_rotate_buffer()` should be used and the damage should be set on the passed state.
This commit is contained in:
parent
62cc96b3a4
commit
eebaca8dbf
@ -90,8 +90,7 @@ static void output_handle_frame(struct wl_listener *listener, void *data) {
|
||||
|
||||
struct wlr_output_state state;
|
||||
wlr_output_state_init(&state);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(output->wlr_output, &state, NULL,
|
||||
NULL);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(output->wlr_output, &state, NULL);
|
||||
if (pass == NULL) {
|
||||
return;
|
||||
}
|
||||
|
@ -94,9 +94,7 @@ static void output_handle_frame(struct wl_listener *listener, void *data) {
|
||||
int width, height;
|
||||
wlr_output_effective_resolution(output->wlr_output, &width, &height);
|
||||
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(output->wlr_output, &output_state,
|
||||
NULL, NULL);
|
||||
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(output->wlr_output, &output_state, NULL);
|
||||
wlr_render_pass_add_rect(pass, &(struct wlr_render_rect_options){
|
||||
.box = { .width = width, .height = height },
|
||||
.color = { 0.3, 0.3, 0.3, 1 },
|
||||
|
@ -114,7 +114,7 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
|
||||
|
||||
struct wlr_output_state output_state;
|
||||
wlr_output_state_init(&output_state);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL, NULL);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL);
|
||||
|
||||
wlr_render_pass_add_rect(pass, &(struct wlr_render_rect_options){
|
||||
.box = { .width = wlr_output->width, .height = wlr_output->height },
|
||||
|
@ -101,7 +101,7 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
|
||||
|
||||
struct wlr_output_state output_state;
|
||||
wlr_output_state_init(&output_state);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL, NULL);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL);
|
||||
wlr_render_pass_add_rect(pass, &(struct wlr_render_rect_options){
|
||||
.box = { .width = wlr_output->width, .height = wlr_output->height },
|
||||
.color = {
|
||||
|
@ -59,7 +59,7 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
|
||||
|
||||
struct wlr_output_state output_state;
|
||||
wlr_output_state_init(&output_state);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL, NULL);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL);
|
||||
|
||||
wlr_render_pass_add_rect(pass, &(struct wlr_render_rect_options){
|
||||
.box = { .width = wlr_output->width, .height = wlr_output->height },
|
||||
|
@ -63,7 +63,7 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
|
||||
|
||||
struct wlr_output_state state;
|
||||
wlr_output_state_init(&state);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &state, NULL, NULL);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &state, NULL);
|
||||
wlr_render_pass_add_rect(pass, &(struct wlr_render_rect_options){
|
||||
.box = { .width = wlr_output->width, .height = wlr_output->height },
|
||||
.color = {
|
||||
|
@ -89,7 +89,7 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
|
||||
|
||||
struct wlr_output_state output_state;
|
||||
wlr_output_state_init(&output_state);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL, NULL);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL);
|
||||
|
||||
wlr_render_pass_add_rect(pass, &(struct wlr_render_rect_options){
|
||||
.box = { .width = wlr_output->width, .height = wlr_output->height },
|
||||
|
@ -76,7 +76,7 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
|
||||
|
||||
struct wlr_output_state output_state;
|
||||
wlr_output_state_init(&output_state);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL, NULL);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL);
|
||||
wlr_render_pass_add_rect(pass, &(struct wlr_render_rect_options){
|
||||
.box = { .width = width, .height = height },
|
||||
.color = { 0.25, 0.25, 0.25, 1 },
|
||||
|
@ -616,7 +616,6 @@ bool wlr_output_configure_primary_swapchain(struct wlr_output *output,
|
||||
* frames or -1 if unknown. This is useful for damage tracking.
|
||||
*/
|
||||
struct wlr_render_pass *wlr_output_begin_render_pass(struct wlr_output *output,
|
||||
struct wlr_output_state *state, int *buffer_age,
|
||||
struct wlr_buffer_pass_options *render_options);
|
||||
struct wlr_output_state *state, struct wlr_buffer_pass_options *render_options);
|
||||
|
||||
#endif
|
||||
|
@ -199,13 +199,12 @@ bool output_pick_format(struct wlr_output *output,
|
||||
}
|
||||
|
||||
struct wlr_render_pass *wlr_output_begin_render_pass(struct wlr_output *output,
|
||||
struct wlr_output_state *state, int *buffer_age,
|
||||
struct wlr_buffer_pass_options *render_options) {
|
||||
struct wlr_output_state *state, struct wlr_buffer_pass_options *render_options) {
|
||||
if (!wlr_output_configure_primary_swapchain(output, state, &output->swapchain)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct wlr_buffer *buffer = wlr_swapchain_acquire(output->swapchain, buffer_age);
|
||||
struct wlr_buffer *buffer = wlr_swapchain_acquire(output->swapchain, NULL);
|
||||
if (buffer == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user