From f24b3df980979d761bd59773f39d6d5f90d17913 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Sat, 19 Aug 2017 08:10:39 +0200 Subject: wlr renderer/texture: rename init to create when it does alloc --- backend/drm/drm.c | 4 ++-- examples/compositor/main.c | 2 +- examples/output-layout.c | 4 ++-- examples/rotation.c | 4 ++-- examples/tablet.c | 2 +- examples/touch.c | 4 ++-- include/render/gles2.h | 2 +- include/wlr/render.h | 2 +- include/wlr/render/gles2.h | 2 +- include/wlr/render/interface.h | 2 +- render/gles2/renderer.c | 8 ++++---- render/gles2/texture.c | 2 +- render/wlr_renderer.c | 4 ++-- types/wlr_output.c | 4 ++-- types/wlr_surface.c | 2 +- 15 files changed, 24 insertions(+), 24 deletions(-) diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 65ea7f45..332926b9 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -598,12 +598,12 @@ static bool wlr_drm_output_set_cursor(struct wlr_output *_output, wlr_matrix_texture(plane->matrix, plane->width, plane->height, output->output.transform ^ WL_OUTPUT_TRANSFORM_FLIPPED_180); - plane->wlr_rend = wlr_gles2_renderer_init(&backend->backend); + plane->wlr_rend = wlr_gles2_renderer_create(&backend->backend); if (!plane->wlr_rend) { return false; } - plane->wlr_tex = wlr_render_texture_init(plane->wlr_rend); + plane->wlr_tex = wlr_render_texture_create(plane->wlr_rend); if (!plane->wlr_tex) { return false; } diff --git a/examples/compositor/main.c b/examples/compositor/main.c index 751a3f23..fdc4ed67 100644 --- a/examples/compositor/main.c +++ b/examples/compositor/main.c @@ -147,7 +147,7 @@ int main() { }; compositor_init(&compositor); - state.renderer = wlr_gles2_renderer_init(compositor.backend); + state.renderer = wlr_gles2_renderer_create(compositor.backend); if (!state.renderer) { wlr_log(L_ERROR, "Could not start compositor, OOM"); exit(EXIT_FAILURE); diff --git a/examples/output-layout.c b/examples/output-layout.c index dd43d2f4..565b21a6 100644 --- a/examples/output-layout.c +++ b/examples/output-layout.c @@ -193,8 +193,8 @@ int main(int argc, char *argv[]) { compositor.keyboard_key_cb = handle_keyboard_key; compositor_init(&compositor); - state.renderer = wlr_gles2_renderer_init(compositor.backend); - state.cat_texture = wlr_render_texture_init(state.renderer); + state.renderer = wlr_gles2_renderer_create(compositor.backend); + state.cat_texture = wlr_render_texture_create(state.renderer); wlr_texture_upload_pixels(state.cat_texture, WL_SHM_FORMAT_ABGR8888, cat_tex.width, cat_tex.width, cat_tex.height, cat_tex.pixel_data); diff --git a/examples/rotation.c b/examples/rotation.c index b663f428..28f82382 100644 --- a/examples/rotation.c +++ b/examples/rotation.c @@ -132,12 +132,12 @@ int main(int argc, char *argv[]) { compositor.keyboard_key_cb = handle_keyboard_key; compositor_init(&compositor); - state.renderer = wlr_gles2_renderer_init(compositor.backend); + state.renderer = wlr_gles2_renderer_create(compositor.backend); if (!state.renderer) { wlr_log(L_ERROR, "Could not start compositor, OOM"); exit(EXIT_FAILURE); } - state.cat_texture = wlr_render_texture_init(state.renderer); + state.cat_texture = wlr_render_texture_create(state.renderer); if (!state.cat_texture) { wlr_log(L_ERROR, "Could not start compositor, OOM"); exit(EXIT_FAILURE); diff --git a/examples/tablet.c b/examples/tablet.c index 17653885..f43fbc52 100644 --- a/examples/tablet.c +++ b/examples/tablet.c @@ -153,7 +153,7 @@ int main(int argc, char *argv[]) { }; compositor_init(&compositor); - state.renderer = wlr_gles2_renderer_init(compositor.backend); + state.renderer = wlr_gles2_renderer_create(compositor.backend); if (!state.renderer) { wlr_log(L_ERROR, "Could not start compositor, OOM"); exit(EXIT_FAILURE); diff --git a/examples/touch.c b/examples/touch.c index 7e01a6c2..8df95e5b 100644 --- a/examples/touch.c +++ b/examples/touch.c @@ -107,12 +107,12 @@ int main(int argc, char *argv[]) { }; compositor_init(&compositor); - state.renderer = wlr_gles2_renderer_init(compositor.backend); + state.renderer = wlr_gles2_renderer_create(compositor.backend); if (!state.renderer) { wlr_log(L_ERROR, "Could not start compositor, OOM"); exit(EXIT_FAILURE); } - state.cat_texture = wlr_render_texture_init(state.renderer); + state.cat_texture = wlr_render_texture_create(state.renderer); if (!state.cat_texture) { wlr_log(L_ERROR, "Could not start compositor, OOM"); exit(EXIT_FAILURE); diff --git a/include/render/gles2.h b/include/render/gles2.h index 0e71d764..79f13ed9 100644 --- a/include/render/gles2.h +++ b/include/render/gles2.h @@ -49,7 +49,7 @@ extern struct shaders shaders; const struct pixel_format *gl_format_for_wl_format(enum wl_shm_format fmt); -struct wlr_texture *gles2_texture_init(); +struct wlr_texture *gles2_texture_create(); extern const GLchar quad_vertex_src[]; extern const GLchar quad_fragment_src[]; diff --git a/include/wlr/render.h b/include/wlr/render.h index 96b61ddf..b7924928 100644 --- a/include/wlr/render.h +++ b/include/wlr/render.h @@ -12,7 +12,7 @@ void wlr_renderer_end(struct wlr_renderer *r); /** * Requests a texture handle from this renderer. */ -struct wlr_texture *wlr_render_texture_init(struct wlr_renderer *r); +struct wlr_texture *wlr_render_texture_create(struct wlr_renderer *r); /** * Renders the requested texture using the provided matrix. A typical texture * rendering goes like so: diff --git a/include/wlr/render/gles2.h b/include/wlr/render/gles2.h index b368d6e1..4a944eb7 100644 --- a/include/wlr/render/gles2.h +++ b/include/wlr/render/gles2.h @@ -4,6 +4,6 @@ #include struct wlr_egl; -struct wlr_renderer *wlr_gles2_renderer_init(struct wlr_backend *backend); +struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_backend *backend); #endif diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h index f98c3bc2..c00e0701 100644 --- a/include/wlr/render/interface.h +++ b/include/wlr/render/interface.h @@ -14,7 +14,7 @@ struct wlr_renderer { struct wlr_renderer_impl { void (*begin)(struct wlr_renderer *renderer, struct wlr_output *output); void (*end)(struct wlr_renderer *renderer); - struct wlr_texture *(*texture_init)(struct wlr_renderer *renderer); + struct wlr_texture *(*texture_create)(struct wlr_renderer *renderer); bool (*render_with_matrix)(struct wlr_renderer *renderer, struct wlr_texture *texture, const float (*matrix)[16]); void (*render_quad)(struct wlr_renderer *renderer, diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c index 1f3c3eeb..f0c724e4 100644 --- a/render/gles2/renderer.c +++ b/render/gles2/renderer.c @@ -143,11 +143,11 @@ static void wlr_gles2_end(struct wlr_renderer *renderer) { // no-op } -static struct wlr_texture *wlr_gles2_texture_init( +static struct wlr_texture *wlr_gles2_texture_create( struct wlr_renderer *_renderer) { struct wlr_gles2_renderer *renderer = (struct wlr_gles2_renderer *)_renderer; - return gles2_texture_init(renderer->egl); + return gles2_texture_create(renderer->egl); } static void draw_quad() { @@ -231,7 +231,7 @@ static bool wlr_gles2_buffer_is_drm(struct wlr_renderer *_renderer, static struct wlr_renderer_impl wlr_renderer_impl = { .begin = wlr_gles2_begin, .end = wlr_gles2_end, - .texture_init = wlr_gles2_texture_init, + .texture_create = wlr_gles2_texture_create, .render_with_matrix = wlr_gles2_render_texture, .render_quad = wlr_gles2_render_quad, .render_ellipse = wlr_gles2_render_ellipse, @@ -239,7 +239,7 @@ static struct wlr_renderer_impl wlr_renderer_impl = { .buffer_is_drm = wlr_gles2_buffer_is_drm, }; -struct wlr_renderer *wlr_gles2_renderer_init(struct wlr_backend *backend) { +struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_backend *backend) { init_globals(); struct wlr_gles2_renderer *renderer; if (!(renderer = calloc(1, sizeof(struct wlr_gles2_renderer)))) { diff --git a/render/gles2/texture.c b/render/gles2/texture.c index 6bb93e4f..f6a9d7eb 100644 --- a/render/gles2/texture.c +++ b/render/gles2/texture.c @@ -276,7 +276,7 @@ static struct wlr_texture_impl wlr_texture_impl = { .destroy = gles2_texture_destroy, }; -struct wlr_texture *gles2_texture_init(struct wlr_egl *egl) { +struct wlr_texture *gles2_texture_create(struct wlr_egl *egl) { struct wlr_gles2_texture *texture; if (!(texture = calloc(1, sizeof(struct wlr_gles2_texture)))) { return NULL; diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c index 2f6c7fad..fec5e38a 100644 --- a/render/wlr_renderer.c +++ b/render/wlr_renderer.c @@ -23,8 +23,8 @@ void wlr_renderer_end(struct wlr_renderer *r) { r->impl->end(r); } -struct wlr_texture *wlr_render_texture_init(struct wlr_renderer *r) { - return r->impl->texture_init(r); +struct wlr_texture *wlr_render_texture_create(struct wlr_renderer *r) { + return r->impl->texture_create(r); } bool wlr_render_with_matrix(struct wlr_renderer *r, diff --git a/types/wlr_output.c b/types/wlr_output.c index e3762733..0a38d591 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -139,14 +139,14 @@ bool wlr_output_set_cursor(struct wlr_output *output, if (!output->cursor.renderer) { /* NULL egl is okay given that we are only using pixel buffers */ - output->cursor.renderer = wlr_gles2_renderer_init(NULL); + output->cursor.renderer = wlr_gles2_renderer_create(NULL); if (!output->cursor.renderer) { return false; } } if (!output->cursor.texture) { - output->cursor.texture = wlr_render_texture_init(output->cursor.renderer); + output->cursor.texture = wlr_render_texture_create(output->cursor.renderer); if (!output->cursor.texture) { return false; } diff --git a/types/wlr_surface.c b/types/wlr_surface.c index 240360a1..894ef899 100644 --- a/types/wlr_surface.c +++ b/types/wlr_surface.c @@ -356,7 +356,7 @@ struct wlr_surface *wlr_surface_create(struct wl_resource *res, return NULL; } surface->renderer = renderer; - surface->texture = wlr_render_texture_init(renderer); + surface->texture = wlr_render_texture_create(renderer); surface->resource = res; surface->current.scale = 1; surface->pending.scale = 1; -- cgit v1.2.3