diff options
author | Simon Ser <contact@emersion.fr> | 2021-06-29 20:39:19 +0200 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-07-01 14:57:52 -0400 |
commit | 18adb43a44cbb31eeeb3d6845690d2cb5c9dc61b (patch) | |
tree | 07248e9c940b145f7c26c6da755cd27ce0dcd6cf | |
parent | 29c8df7e0a3e6ac1720cd843ba6f523de6b71c0a (diff) |
render: drop wlr_renderer_impl.texture_from_pixels
-rw-r--r-- | include/render/gles2.h | 3 | ||||
-rw-r--r-- | include/wlr/render/interface.h | 3 | ||||
-rw-r--r-- | render/gles2/renderer.c | 1 | ||||
-rw-r--r-- | render/gles2/texture.c | 3 | ||||
-rw-r--r-- | render/pixman/renderer.c | 35 | ||||
-rw-r--r-- | render/wlr_renderer.c | 1 |
6 files changed, 2 insertions, 44 deletions
diff --git a/include/render/gles2.h b/include/render/gles2.h index 0e93522f..b32b5708 100644 --- a/include/render/gles2.h +++ b/include/render/gles2.h @@ -119,9 +119,6 @@ struct wlr_gles2_renderer *gles2_get_renderer( struct wlr_gles2_texture *gles2_get_texture( struct wlr_texture *wlr_texture); -struct wlr_texture *gles2_texture_from_pixels(struct wlr_renderer *wlr_renderer, - uint32_t fmt, uint32_t stride, uint32_t width, uint32_t height, - const void *data); struct wlr_texture *gles2_texture_from_wl_drm(struct wlr_renderer *wlr_renderer, struct wl_resource *data); struct wlr_texture *gles2_texture_from_dmabuf(struct wlr_renderer *wlr_renderer, diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h index b07c7c6f..54e0fc5c 100644 --- a/include/wlr/render/interface.h +++ b/include/wlr/render/interface.h @@ -45,9 +45,6 @@ struct wlr_renderer_impl { uint32_t *flags, uint32_t stride, uint32_t width, uint32_t height, uint32_t src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y, void *data); - struct wlr_texture *(*texture_from_pixels)(struct wlr_renderer *renderer, - uint32_t fmt, uint32_t stride, uint32_t width, uint32_t height, - const void *data); struct wlr_texture *(*texture_from_wl_drm)(struct wlr_renderer *renderer, struct wl_resource *data); struct wlr_texture *(*texture_from_dmabuf)(struct wlr_renderer *renderer, diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c index 9bfaebd7..8f1bf883 100644 --- a/render/gles2/renderer.c +++ b/render/gles2/renderer.c @@ -592,7 +592,6 @@ static const struct wlr_renderer_impl renderer_impl = { .get_render_formats = gles2_get_render_formats, .preferred_read_format = gles2_preferred_read_format, .read_pixels = gles2_read_pixels, - .texture_from_pixels = gles2_texture_from_pixels, .texture_from_wl_drm = gles2_texture_from_wl_drm, .texture_from_dmabuf = gles2_texture_from_dmabuf, .init_wl_display = gles2_init_wl_display, diff --git a/render/gles2/texture.c b/render/gles2/texture.c index 303ac411..87710a18 100644 --- a/render/gles2/texture.c +++ b/render/gles2/texture.c @@ -179,7 +179,8 @@ static struct wlr_gles2_texture *gles2_texture_create( return texture; } -struct wlr_texture *gles2_texture_from_pixels(struct wlr_renderer *wlr_renderer, +static struct wlr_texture *gles2_texture_from_pixels( + struct wlr_renderer *wlr_renderer, uint32_t drm_format, uint32_t stride, uint32_t width, uint32_t height, const void *data) { struct wlr_gles2_renderer *renderer = gles2_get_renderer(wlr_renderer); diff --git a/render/pixman/renderer.c b/render/pixman/renderer.c index f1c1a3d5..71af1939 100644 --- a/render/pixman/renderer.c +++ b/render/pixman/renderer.c @@ -368,40 +368,6 @@ static struct wlr_pixman_texture *pixman_texture_create( return texture; } -static struct wlr_texture *pixman_texture_from_pixels( - struct wlr_renderer *wlr_renderer, uint32_t drm_format, - uint32_t stride, uint32_t width, uint32_t height, const void *data) { - struct wlr_pixman_renderer *renderer = get_renderer(wlr_renderer); - - struct wlr_pixman_texture *texture = - pixman_texture_create(renderer, drm_format, width, height); - if (texture == NULL) { - return NULL; - } - - // TODO: avoid this copy - texture->data = malloc(stride * height); - if (texture->data == NULL) { - wlr_log_errno(WLR_ERROR, "Allocation failed"); - wl_list_remove(&texture->link); - free(texture); - return NULL; - } - memcpy(texture->data, data, stride * height); - - texture->image = pixman_image_create_bits_no_clear(texture->format, - width, height, texture->data, stride); - if (!texture->image) { - wlr_log(WLR_ERROR, "Failed to create pixman image"); - wl_list_remove(&texture->link); - free(texture->data); - free(texture); - return NULL; - } - - return &texture->wlr_texture; -} - static struct wlr_texture *pixman_texture_from_buffer( struct wlr_renderer *wlr_renderer, struct wlr_buffer *buffer) { struct wlr_pixman_renderer *renderer = get_renderer(wlr_renderer); @@ -531,7 +497,6 @@ static const struct wlr_renderer_impl renderer_impl = { .render_quad_with_matrix = pixman_render_quad_with_matrix, .get_shm_texture_formats = pixman_get_shm_texture_formats, .get_render_formats = pixman_get_render_formats, - .texture_from_pixels = pixman_texture_from_pixels, .texture_from_buffer = pixman_texture_from_buffer, .bind_buffer = pixman_bind_buffer, .destroy = pixman_destroy, diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c index f661d8d0..dc9c3a99 100644 --- a/render/wlr_renderer.c +++ b/render/wlr_renderer.c @@ -26,7 +26,6 @@ void wlr_renderer_init(struct wlr_renderer *renderer, assert(impl->render_subtexture_with_matrix); assert(impl->render_quad_with_matrix); assert(impl->get_shm_texture_formats); - assert(impl->texture_from_pixels); assert(impl->get_render_buffer_caps); renderer->impl = impl; |