mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-05 13:29:47 -05:00
render: add timeline wlr_renderer API
This commit is contained in:
parent
4ac4d28833
commit
8cf53ecc46
3 changed files with 49 additions and 0 deletions
|
|
@ -48,6 +48,10 @@ struct wlr_renderer_impl {
|
|||
uint32_t (*get_render_buffer_caps)(struct wlr_renderer *renderer);
|
||||
struct wlr_texture *(*texture_from_buffer)(struct wlr_renderer *renderer,
|
||||
struct wlr_buffer *buffer);
|
||||
bool (*wait_timeline)(struct wlr_renderer *renderer,
|
||||
struct wlr_render_timeline *timeline, uint64_t src_point);
|
||||
bool (*signal_timeline)(struct wlr_renderer *renderer,
|
||||
struct wlr_render_timeline *timeline, uint64_t dst_point);
|
||||
};
|
||||
|
||||
void wlr_renderer_init(struct wlr_renderer *renderer,
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ struct wlr_drm_format_set;
|
|||
struct wlr_buffer;
|
||||
struct wlr_box;
|
||||
struct wlr_fbox;
|
||||
struct wlr_render_timeline;
|
||||
|
||||
struct wlr_renderer {
|
||||
const struct wlr_renderer_impl *impl;
|
||||
|
|
@ -119,6 +120,34 @@ bool wlr_renderer_init_wl_shm(struct wlr_renderer *r,
|
|||
*/
|
||||
int wlr_renderer_get_drm_fd(struct wlr_renderer *r);
|
||||
|
||||
/**
|
||||
* Wait for a timeline synchronization point before continuing rendering
|
||||
* operations.
|
||||
*
|
||||
* The renderer implementation is allowed to wait sooner, e.g. wait before
|
||||
* executing any rendering operation since the previous wlr_renderer_begin()
|
||||
* call.
|
||||
*
|
||||
* When a compositor calls wlr_renderer_wait_timeline(), the renderer is
|
||||
* allowed to skip implicit wait synchronization. Compositors are not allowed
|
||||
* to mix implicit and explicit wait synchronization usage.
|
||||
*/
|
||||
bool wlr_renderer_wait_timeline(struct wlr_renderer *renderer,
|
||||
struct wlr_render_timeline *timeline, uint64_t src_point);
|
||||
/**
|
||||
* Signal a timeline synchronization point when all previous rendering
|
||||
* operations have finished.
|
||||
*
|
||||
* The renderer implementation is allowed to signal later, e.g. signal when all
|
||||
* rendering operations up to wlr_renderer_end() have finished.
|
||||
*
|
||||
* When a compositor calls wlr_renderer_signal_timeline(), the renderer is
|
||||
* allowed to skip implicit signal synchronization. Compositors are not allowed
|
||||
* to mix implicit and explicit signal synchronization usage.
|
||||
*/
|
||||
bool wlr_renderer_signal_timeline(struct wlr_renderer *renderer,
|
||||
struct wlr_render_timeline *timeline, uint64_t dst_point);
|
||||
|
||||
/**
|
||||
* Destroys the renderer.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -414,3 +414,19 @@ int wlr_renderer_get_drm_fd(struct wlr_renderer *r) {
|
|||
}
|
||||
return r->impl->get_drm_fd(r);
|
||||
}
|
||||
|
||||
bool wlr_renderer_wait_timeline(struct wlr_renderer *r,
|
||||
struct wlr_render_timeline *timeline, uint64_t src_point) {
|
||||
if (!r->impl->wait_timeline) {
|
||||
return false;
|
||||
}
|
||||
return r->impl->wait_timeline(r, timeline, src_point);
|
||||
}
|
||||
|
||||
bool wlr_renderer_signal_timeline(struct wlr_renderer *r,
|
||||
struct wlr_render_timeline *timeline, uint64_t dst_point) {
|
||||
if (!r->impl->signal_timeline) {
|
||||
return false;
|
||||
}
|
||||
return r->impl->signal_timeline(r, timeline, dst_point);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue