mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-26 06:35:58 +01:00
render: rename wlr_renderer_get_formats
Rename wlr_renderer_get_formats to wlr_renderer_get_shm_texture_formats. This makes it clear those formats are only suitable for shm import.
This commit is contained in:
parent
49115e9d5d
commit
c94ab99ae2
4 changed files with 10 additions and 9 deletions
|
@ -44,7 +44,7 @@ struct wlr_renderer_impl {
|
||||||
const float color[static 4], const float matrix[static 9]);
|
const float color[static 4], const float matrix[static 9]);
|
||||||
void (*render_ellipse_with_matrix)(struct wlr_renderer *renderer,
|
void (*render_ellipse_with_matrix)(struct wlr_renderer *renderer,
|
||||||
const float color[static 4], const float matrix[static 9]);
|
const float color[static 4], const float matrix[static 9]);
|
||||||
const enum wl_shm_format *(*formats)(
|
const enum wl_shm_format *(*get_shm_texture_formats)(
|
||||||
struct wlr_renderer *renderer, size_t *len);
|
struct wlr_renderer *renderer, size_t *len);
|
||||||
bool (*resource_is_wl_drm_buffer)(struct wlr_renderer *renderer,
|
bool (*resource_is_wl_drm_buffer)(struct wlr_renderer *renderer,
|
||||||
struct wl_resource *resource);
|
struct wl_resource *resource);
|
||||||
|
|
|
@ -86,8 +86,8 @@ void wlr_render_ellipse_with_matrix(struct wlr_renderer *r,
|
||||||
* Get the shared-memory formats supporting import usage. Buffers allocated
|
* Get the shared-memory formats supporting import usage. Buffers allocated
|
||||||
* with a format from this list may be imported via wlr_texture_from_pixels.
|
* with a format from this list may be imported via wlr_texture_from_pixels.
|
||||||
*/
|
*/
|
||||||
const enum wl_shm_format *wlr_renderer_get_formats(struct wlr_renderer *r,
|
const enum wl_shm_format *wlr_renderer_get_shm_texture_formats(
|
||||||
size_t *len);
|
struct wlr_renderer *r, size_t *len);
|
||||||
/**
|
/**
|
||||||
* Returns true if this wl_buffer is a wl_drm buffer.
|
* Returns true if this wl_buffer is a wl_drm buffer.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -396,7 +396,7 @@ static void gles2_render_ellipse_with_matrix(struct wlr_renderer *wlr_renderer,
|
||||||
pop_gles2_debug(renderer);
|
pop_gles2_debug(renderer);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const enum wl_shm_format *gles2_renderer_formats(
|
static const enum wl_shm_format *gles2_get_shm_texture_formats(
|
||||||
struct wlr_renderer *wlr_renderer, size_t *len) {
|
struct wlr_renderer *wlr_renderer, size_t *len) {
|
||||||
return get_gles2_wl_formats(len);
|
return get_gles2_wl_formats(len);
|
||||||
}
|
}
|
||||||
|
@ -705,7 +705,7 @@ static const struct wlr_renderer_impl renderer_impl = {
|
||||||
.render_subtexture_with_matrix = gles2_render_subtexture_with_matrix,
|
.render_subtexture_with_matrix = gles2_render_subtexture_with_matrix,
|
||||||
.render_quad_with_matrix = gles2_render_quad_with_matrix,
|
.render_quad_with_matrix = gles2_render_quad_with_matrix,
|
||||||
.render_ellipse_with_matrix = gles2_render_ellipse_with_matrix,
|
.render_ellipse_with_matrix = gles2_render_ellipse_with_matrix,
|
||||||
.formats = gles2_renderer_formats,
|
.get_shm_texture_formats = gles2_get_shm_texture_formats,
|
||||||
.resource_is_wl_drm_buffer = gles2_resource_is_wl_drm_buffer,
|
.resource_is_wl_drm_buffer = gles2_resource_is_wl_drm_buffer,
|
||||||
.wl_drm_buffer_get_size = gles2_wl_drm_buffer_get_size,
|
.wl_drm_buffer_get_size = gles2_wl_drm_buffer_get_size,
|
||||||
.get_dmabuf_texture_formats = gles2_get_dmabuf_texture_formats,
|
.get_dmabuf_texture_formats = gles2_get_dmabuf_texture_formats,
|
||||||
|
|
|
@ -17,7 +17,7 @@ void wlr_renderer_init(struct wlr_renderer *renderer,
|
||||||
assert(impl->render_subtexture_with_matrix);
|
assert(impl->render_subtexture_with_matrix);
|
||||||
assert(impl->render_quad_with_matrix);
|
assert(impl->render_quad_with_matrix);
|
||||||
assert(impl->render_ellipse_with_matrix);
|
assert(impl->render_ellipse_with_matrix);
|
||||||
assert(impl->formats);
|
assert(impl->get_shm_texture_formats);
|
||||||
assert(impl->texture_from_pixels);
|
assert(impl->texture_from_pixels);
|
||||||
renderer->impl = impl;
|
renderer->impl = impl;
|
||||||
|
|
||||||
|
@ -144,9 +144,9 @@ void wlr_render_ellipse_with_matrix(struct wlr_renderer *r,
|
||||||
r->impl->render_ellipse_with_matrix(r, color, matrix);
|
r->impl->render_ellipse_with_matrix(r, color, matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
const enum wl_shm_format *wlr_renderer_get_formats(
|
const enum wl_shm_format *wlr_renderer_get_shm_texture_formats(
|
||||||
struct wlr_renderer *r, size_t *len) {
|
struct wlr_renderer *r, size_t *len) {
|
||||||
return r->impl->formats(r, len);
|
return r->impl->get_shm_texture_formats(r, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wlr_renderer_resource_is_wl_drm_buffer(struct wlr_renderer *r,
|
bool wlr_renderer_resource_is_wl_drm_buffer(struct wlr_renderer *r,
|
||||||
|
@ -210,7 +210,8 @@ bool wlr_renderer_init_wl_display(struct wlr_renderer *r,
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t len;
|
size_t len;
|
||||||
const enum wl_shm_format *formats = wlr_renderer_get_formats(r, &len);
|
const enum wl_shm_format *formats =
|
||||||
|
wlr_renderer_get_shm_texture_formats(r, &len);
|
||||||
if (formats == NULL) {
|
if (formats == NULL) {
|
||||||
wlr_log(WLR_ERROR, "Failed to initialize shm: cannot get formats");
|
wlr_log(WLR_ERROR, "Failed to initialize shm: cannot get formats");
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue