wlr_texture: Drop wlr_texture_from_pixels

Keeping the texture version doesn't make too much sense because compositors
should send valid pixel data the first time around meaning they want to
render straight away. wlr_raster_from_pixels should be used instead.

Also drop a few asserts that are impossible because of the data type.
This commit is contained in:
Alexander Orzechowski 2022-06-20 23:59:22 -04:00
parent dae7bd1413
commit 33ae408579
2 changed files with 0 additions and 32 deletions

View file

@ -26,14 +26,6 @@ struct wlr_texture {
struct wl_list link;
};
/**
* Create a new texture from raw pixel data. `stride` is in bytes. The returned
* texture is mutable.
*/
struct wlr_texture *wlr_texture_from_pixels(struct wlr_renderer *renderer,
uint32_t fmt, uint32_t stride, uint32_t width, uint32_t height,
const void *data);
/**
* Update a texture with a struct wlr_buffer's contents.
*

View file

@ -32,30 +32,6 @@ void wlr_texture_destroy(struct wlr_texture *texture) {
}
}
struct wlr_texture *wlr_texture_from_pixels(struct wlr_renderer *renderer,
uint32_t fmt, uint32_t stride, uint32_t width, uint32_t height,
const void *data) {
assert(width > 0);
assert(height > 0);
assert(stride > 0);
assert(data);
struct wlr_readonly_data_buffer *buffer =
readonly_data_buffer_create(fmt, stride, width, height, data);
if (buffer == NULL) {
return NULL;
}
struct wlr_texture *texture =
wlr_texture_from_buffer(renderer, &buffer->base);
// By this point, the renderer should have locked the buffer if it still
// needs to access it in the future.
readonly_data_buffer_drop(buffer);
return texture;
}
struct wlr_texture *wlr_texture_from_buffer(struct wlr_renderer *renderer,
struct wlr_buffer *buffer) {
if (!renderer->impl->texture_from_buffer) {