output: rename needs_commit to needs_frame

This new name makes more sense, since it is a request from the backend to get
a new frame. In the future a commit may not convey a new frame.
This commit is contained in:
Simon Ser 2019-04-23 20:22:42 +03:00 committed by Drew DeVault
parent 5e6766a165
commit 20690346c7
10 changed files with 31 additions and 31 deletions

View file

@ -273,7 +273,7 @@ void wlr_output_init(struct wlr_output *output, struct wlr_backend *backend,
wl_list_init(&output->cursors);
wl_list_init(&output->resources);
wl_signal_init(&output->events.frame);
wl_signal_init(&output->events.needs_commit);
wl_signal_init(&output->events.needs_frame);
wl_signal_init(&output->events.precommit);
wl_signal_init(&output->events.commit);
wl_signal_init(&output->events.present);
@ -437,7 +437,7 @@ bool wlr_output_commit(struct wlr_output *output) {
wlr_signal_emit_safe(&output->events.commit, output);
output->frame_pending = true;
output->needs_commit = false;
output->needs_frame = false;
output_state_clear(&output->pending);
return true;
}
@ -517,9 +517,9 @@ bool wlr_output_export_dmabuf(struct wlr_output *output,
return output->impl->export_dmabuf(output, attribs);
}
void wlr_output_update_needs_commit(struct wlr_output *output) {
output->needs_commit = true;
wlr_signal_emit_safe(&output->events.needs_commit, output);
void wlr_output_update_needs_frame(struct wlr_output *output) {
output->needs_frame = true;
wlr_signal_emit_safe(&output->events.needs_frame, output);
}
void wlr_output_damage_whole(struct wlr_output *output) {
@ -528,7 +528,7 @@ void wlr_output_damage_whole(struct wlr_output *output) {
pixman_region32_union_rect(&output->damage, &output->damage, 0, 0,
width, height);
wlr_output_update_needs_commit(output);
wlr_output_update_needs_frame(output);
}
struct wlr_output *wlr_output_from_resource(struct wl_resource *resource) {
@ -674,7 +674,7 @@ static void output_cursor_damage_whole(struct wlr_output_cursor *cursor) {
output_cursor_get_box(cursor, &box);
pixman_region32_union_rect(&cursor->output->damage, &cursor->output->damage,
box.x, box.y, box.width, box.height);
wlr_output_update_needs_commit(cursor->output);
wlr_output_update_needs_frame(cursor->output);
}
static void output_cursor_reset(struct wlr_output_cursor *cursor) {

View file

@ -31,10 +31,10 @@ static void output_handle_scale(struct wl_listener *listener, void *data) {
wlr_output_damage_add_whole(output_damage);
}
static void output_handle_needs_commit(struct wl_listener *listener,
static void output_handle_needs_frame(struct wl_listener *listener,
void *data) {
struct wlr_output_damage *output_damage =
wl_container_of(listener, output_damage, output_needs_commit);
wl_container_of(listener, output_damage, output_needs_frame);
pixman_region32_union(&output_damage->current, &output_damage->current,
&output_damage->output->damage);
wlr_output_schedule_frame(output_damage->output);
@ -93,8 +93,8 @@ struct wlr_output_damage *wlr_output_damage_create(struct wlr_output *output) {
output_damage->output_transform.notify = output_handle_transform;
wl_signal_add(&output->events.scale, &output_damage->output_scale);
output_damage->output_scale.notify = output_handle_scale;
wl_signal_add(&output->events.needs_commit, &output_damage->output_needs_commit);
output_damage->output_needs_commit.notify = output_handle_needs_commit;
wl_signal_add(&output->events.needs_frame, &output_damage->output_needs_frame);
output_damage->output_needs_frame.notify = output_handle_needs_frame;
wl_signal_add(&output->events.frame, &output_damage->output_frame);
output_damage->output_frame.notify = output_handle_frame;
wl_signal_add(&output->events.commit, &output_damage->output_commit);
@ -112,7 +112,7 @@ void wlr_output_damage_destroy(struct wlr_output_damage *output_damage) {
wl_list_remove(&output_damage->output_mode.link);
wl_list_remove(&output_damage->output_transform.link);
wl_list_remove(&output_damage->output_scale.link);
wl_list_remove(&output_damage->output_needs_commit.link);
wl_list_remove(&output_damage->output_needs_frame.link);
wl_list_remove(&output_damage->output_frame.link);
pixman_region32_fini(&output_damage->current);
for (size_t i = 0; i < WLR_OUTPUT_DAMAGE_PREVIOUS_LEN; ++i) {
@ -122,7 +122,7 @@ void wlr_output_damage_destroy(struct wlr_output_damage *output_damage) {
}
bool wlr_output_damage_attach_render(struct wlr_output_damage *output_damage,
bool *needs_commit, pixman_region32_t *damage) {
bool *needs_frame, pixman_region32_t *damage) {
struct wlr_output *output = output_damage->output;
int buffer_age = -1;
@ -156,7 +156,7 @@ bool wlr_output_damage_attach_render(struct wlr_output_damage *output_damage,
}
}
*needs_commit = output->needs_commit || pixman_region32_not_empty(damage);
*needs_frame = output->needs_frame || pixman_region32_not_empty(damage);
return true;
}

View file

@ -140,7 +140,7 @@ static void frame_handle_copy(struct wl_client *client,
frame->buffer_destroy.notify = frame_handle_buffer_destroy;
// Schedule a buffer commit
output->needs_commit = true;
output->needs_frame = true;
wlr_output_schedule_frame(output);
if (frame->overlay_cursor) {

View file

@ -150,7 +150,7 @@ static void screenshooter_shoot(struct wl_client *client,
wl_signal_add(&output->events.precommit, &state->frame_listener);
// Schedule a buffer commit
output->needs_commit = true;
output->needs_frame = true;
wlr_output_schedule_frame(output);
}