mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-25 22:25:58 +01:00
render: allow texture creation while rendering
This removes an artificial limitation in form of an assert that disallowed the creation of textures while the renderer is rendering. A consumer might run its own rendering pipeline and after start of the renderer still want to create textures for internal usage.
This commit is contained in:
parent
e279266f71
commit
17a289e36e
2 changed files with 0 additions and 13 deletions
|
@ -25,9 +25,6 @@ struct wlr_texture {
|
||||||
/**
|
/**
|
||||||
* Create a new texture from raw pixel data. `stride` is in bytes. The returned
|
* Create a new texture from raw pixel data. `stride` is in bytes. The returned
|
||||||
* texture is mutable.
|
* texture is mutable.
|
||||||
*
|
|
||||||
* Should not be called in a rendering block like renderer_begin()/end() or
|
|
||||||
* between attaching a renderer to an output and committing it.
|
|
||||||
*/
|
*/
|
||||||
struct wlr_texture *wlr_texture_from_pixels(struct wlr_renderer *renderer,
|
struct wlr_texture *wlr_texture_from_pixels(struct wlr_renderer *renderer,
|
||||||
uint32_t fmt, uint32_t stride, uint32_t width, uint32_t height,
|
uint32_t fmt, uint32_t stride, uint32_t width, uint32_t height,
|
||||||
|
@ -35,9 +32,6 @@ struct wlr_texture *wlr_texture_from_pixels(struct wlr_renderer *renderer,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new texture from a DMA-BUF. The returned texture is immutable.
|
* Create a new texture from a DMA-BUF. The returned texture is immutable.
|
||||||
*
|
|
||||||
* Should not be called in a rendering block like renderer_begin()/end() or
|
|
||||||
* between attaching a renderer to an output and committing it.
|
|
||||||
*/
|
*/
|
||||||
struct wlr_texture *wlr_texture_from_dmabuf(struct wlr_renderer *renderer,
|
struct wlr_texture *wlr_texture_from_dmabuf(struct wlr_renderer *renderer,
|
||||||
struct wlr_dmabuf_attributes *attribs);
|
struct wlr_dmabuf_attributes *attribs);
|
||||||
|
@ -50,9 +44,6 @@ bool wlr_texture_is_opaque(struct wlr_texture *texture);
|
||||||
/**
|
/**
|
||||||
* Update a texture with raw pixels. The texture must be mutable, and the input
|
* Update a texture with raw pixels. The texture must be mutable, and the input
|
||||||
* data must have the same pixel format that the texture was created with.
|
* data must have the same pixel format that the texture was created with.
|
||||||
*
|
|
||||||
* Should not be called in a rendering block like renderer_begin()/end() or
|
|
||||||
* between attaching a renderer to an output and committing it.
|
|
||||||
*/
|
*/
|
||||||
bool wlr_texture_write_pixels(struct wlr_texture *texture,
|
bool wlr_texture_write_pixels(struct wlr_texture *texture,
|
||||||
uint32_t stride, uint32_t width, uint32_t height,
|
uint32_t stride, uint32_t width, uint32_t height,
|
||||||
|
@ -66,9 +57,6 @@ void wlr_texture_destroy(struct wlr_texture *texture);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new texture from a buffer.
|
* Create a new texture from a buffer.
|
||||||
*
|
|
||||||
* Should not be called in a rendering block like renderer_begin()/end() or
|
|
||||||
* between attaching a renderer to an output and committing it.
|
|
||||||
*/
|
*/
|
||||||
struct wlr_texture *wlr_texture_from_buffer(struct wlr_renderer *renderer,
|
struct wlr_texture *wlr_texture_from_buffer(struct wlr_renderer *renderer,
|
||||||
struct wlr_buffer *buffer);
|
struct wlr_buffer *buffer);
|
||||||
|
|
|
@ -63,7 +63,6 @@ struct wlr_texture *wlr_texture_from_dmabuf(struct wlr_renderer *renderer,
|
||||||
|
|
||||||
struct wlr_texture *wlr_texture_from_buffer(struct wlr_renderer *renderer,
|
struct wlr_texture *wlr_texture_from_buffer(struct wlr_renderer *renderer,
|
||||||
struct wlr_buffer *buffer) {
|
struct wlr_buffer *buffer) {
|
||||||
assert(!renderer->rendering);
|
|
||||||
if (!renderer->impl->texture_from_buffer) {
|
if (!renderer->impl->texture_from_buffer) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue