diff options
author | Alexander Orzechowski <alex@ozal.ski> | 2023-11-29 15:13:24 -0500 |
---|---|---|
committer | Alexander Orzechowski <alex@ozal.ski> | 2023-11-29 15:13:24 -0500 |
commit | 3faf9883dcb31c7aeb47327b3cd3c6db963105a9 (patch) | |
tree | 17de0ed12577b467e6723fdb8185494a153f9792 | |
parent | 20935646168f5b709947a3ec2402189ecbd35d91 (diff) |
renderer: Drop wlr_renderer_begin
-rw-r--r-- | include/wlr/render/wlr_renderer.h | 9 | ||||
-rw-r--r-- | render/wlr_renderer.c | 17 |
2 files changed, 5 insertions, 21 deletions
diff --git a/include/wlr/render/wlr_renderer.h b/include/wlr/render/wlr_renderer.h index 282ee4bb..8f4f61ee 100644 --- a/include/wlr/render/wlr_renderer.h +++ b/include/wlr/render/wlr_renderer.h @@ -53,15 +53,6 @@ struct wlr_renderer { struct wlr_renderer *wlr_renderer_autocreate(struct wlr_backend *backend); /** - * Start a render pass with the provided viewport. - * - * This should be called after wlr_output_attach_render(). Compositors must call - * wlr_renderer_end() when they are done. - * - * Returns false on failure, in which case compositors shouldn't try rendering. - */ -bool wlr_renderer_begin(struct wlr_renderer *r, uint32_t width, uint32_t height); -/** * Start a render pass on the provided struct wlr_buffer. * * Compositors must call wlr_renderer_end() when they are done. diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c index 6711cb6b..b2258fce 100644 --- a/render/wlr_renderer.c +++ b/render/wlr_renderer.c @@ -68,26 +68,19 @@ bool renderer_bind_buffer(struct wlr_renderer *r, struct wlr_buffer *buffer) { return r->impl->bind_buffer(r, buffer); } -bool wlr_renderer_begin(struct wlr_renderer *r, uint32_t width, uint32_t height) { - assert(!r->rendering); - - if (!r->impl->begin(r, width, height)) { - return false; - } - - r->rendering = true; - return true; -} - bool wlr_renderer_begin_with_buffer(struct wlr_renderer *r, struct wlr_buffer *buffer) { + assert(!r->rendering); + if (!renderer_bind_buffer(r, buffer)) { return false; } - if (!wlr_renderer_begin(r, buffer->width, buffer->height)) { + if (!r->impl->begin(r, buffer->width, buffer->height)) { renderer_bind_buffer(r, NULL); return false; } + + r->rendering = true; r->rendering_with_buffer = true; return true; } |