mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
Change all timespec pointers in events to owned
Follow-up from !4803. Make things consistent by making all `struct timespec`s in events owned. Reduces the need for thinking about ownership/lifetimes.
This commit is contained in:
parent
f04ef79f61
commit
c9f0dbc159
6 changed files with 10 additions and 10 deletions
|
|
@ -245,13 +245,13 @@ struct wlr_output_event_damage {
|
||||||
|
|
||||||
struct wlr_output_event_precommit {
|
struct wlr_output_event_precommit {
|
||||||
struct wlr_output *output;
|
struct wlr_output *output;
|
||||||
struct timespec *when;
|
struct timespec when;
|
||||||
const struct wlr_output_state *state;
|
const struct wlr_output_state *state;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct wlr_output_event_commit {
|
struct wlr_output_event_commit {
|
||||||
struct wlr_output *output;
|
struct wlr_output *output;
|
||||||
struct timespec *when;
|
struct timespec when;
|
||||||
const struct wlr_output_state *state;
|
const struct wlr_output_state *state;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ struct wlr_ext_output_image_capture_source_v1 {
|
||||||
struct wlr_ext_output_image_capture_source_v1_frame_event {
|
struct wlr_ext_output_image_capture_source_v1_frame_event {
|
||||||
struct wlr_ext_image_capture_source_v1_frame_event base;
|
struct wlr_ext_image_capture_source_v1_frame_event base;
|
||||||
struct wlr_buffer *buffer;
|
struct wlr_buffer *buffer;
|
||||||
struct timespec *when;
|
struct timespec when;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void output_source_start(struct wlr_ext_image_capture_source_v1 *base,
|
static void output_source_start(struct wlr_ext_image_capture_source_v1 *base,
|
||||||
|
|
@ -85,7 +85,7 @@ static void output_source_copy_frame(struct wlr_ext_image_capture_source_v1 *bas
|
||||||
if (wlr_ext_image_copy_capture_frame_v1_copy_buffer(frame,
|
if (wlr_ext_image_copy_capture_frame_v1_copy_buffer(frame,
|
||||||
event->buffer, source->output->renderer)) {
|
event->buffer, source->output->renderer)) {
|
||||||
wlr_ext_image_copy_capture_frame_v1_ready(frame,
|
wlr_ext_image_copy_capture_frame_v1_ready(frame,
|
||||||
source->output->transform, event->when);
|
source->output->transform, &event->when);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -728,7 +728,7 @@ bool output_prepare_commit(struct wlr_output *output, const struct wlr_output_st
|
||||||
|
|
||||||
struct wlr_output_event_precommit pre_event = {
|
struct wlr_output_event_precommit pre_event = {
|
||||||
.output = output,
|
.output = output,
|
||||||
.when = &now,
|
.when = now,
|
||||||
.state = state,
|
.state = state,
|
||||||
};
|
};
|
||||||
wl_signal_emit_mutable(&output->events.precommit, &pre_event);
|
wl_signal_emit_mutable(&output->events.precommit, &pre_event);
|
||||||
|
|
@ -750,7 +750,7 @@ void output_apply_commit(struct wlr_output *output, const struct wlr_output_stat
|
||||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||||
struct wlr_output_event_commit event = {
|
struct wlr_output_event_commit event = {
|
||||||
.output = output,
|
.output = output,
|
||||||
.when = &now,
|
.when = now,
|
||||||
.state = state,
|
.state = state,
|
||||||
};
|
};
|
||||||
wl_signal_emit_mutable(&output->events.commit, &event);
|
wl_signal_emit_mutable(&output->events.commit, &event);
|
||||||
|
|
|
||||||
|
|
@ -650,7 +650,7 @@ static void output_cursor_output_handle_output_commit(
|
||||||
struct wlr_surface *surface = output_cursor->cursor->state->surface;
|
struct wlr_surface *surface = output_cursor->cursor->state->surface;
|
||||||
if (surface && output_cursor->output_cursor->visible &&
|
if (surface && output_cursor->output_cursor->visible &&
|
||||||
(event->state->committed & WLR_OUTPUT_STATE_BUFFER)) {
|
(event->state->committed & WLR_OUTPUT_STATE_BUFFER)) {
|
||||||
wlr_surface_send_frame_done(surface, event->when);
|
wlr_surface_send_frame_done(surface, &event->when);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,11 +85,11 @@ static void frame_output_handle_commit(struct wl_listener *listener,
|
||||||
attribs.fd[i], size, attribs.offset[i], attribs.stride[i], i);
|
attribs.fd[i], size, attribs.offset[i], attribs.stride[i], i);
|
||||||
}
|
}
|
||||||
|
|
||||||
time_t tv_sec = event->when->tv_sec;
|
time_t tv_sec = event->when.tv_sec;
|
||||||
uint32_t tv_sec_hi = (sizeof(tv_sec) > 4) ? tv_sec >> 32 : 0;
|
uint32_t tv_sec_hi = (sizeof(tv_sec) > 4) ? tv_sec >> 32 : 0;
|
||||||
uint32_t tv_sec_lo = tv_sec & 0xFFFFFFFF;
|
uint32_t tv_sec_lo = tv_sec & 0xFFFFFFFF;
|
||||||
zwlr_export_dmabuf_frame_v1_send_ready(frame->resource,
|
zwlr_export_dmabuf_frame_v1_send_ready(frame->resource,
|
||||||
tv_sec_hi, tv_sec_lo, event->when->tv_nsec);
|
tv_sec_hi, tv_sec_lo, event->when.tv_nsec);
|
||||||
frame_destroy(frame);
|
frame_destroy(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -334,7 +334,7 @@ static void frame_handle_output_commit(struct wl_listener *listener,
|
||||||
|
|
||||||
zwlr_screencopy_frame_v1_send_flags(frame->resource, 0);
|
zwlr_screencopy_frame_v1_send_flags(frame->resource, 0);
|
||||||
frame_send_damage(frame);
|
frame_send_damage(frame);
|
||||||
frame_send_ready(frame, event->when);
|
frame_send_ready(frame, &event->when);
|
||||||
frame_destroy(frame);
|
frame_destroy(frame);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue