diff options
author | zccrs <zccrs@live.com> | 2021-05-28 14:06:49 +0800 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-06-19 10:04:35 +0200 |
commit | fdc40e071ed103d6bdc03fa6181dedef296b0509 (patch) | |
tree | d31934907fb002216244b612741cbf17dc5c50f1 | |
parent | 103edde4810e35b5a95be4205436239a5ee724c9 (diff) |
render/gles2: add wlr_renderer_is_gles2
Export the interface used to determine whether the wlr_renderer object
is gles2.
-rw-r--r-- | include/wlr/render/gles2.h | 1 | ||||
-rw-r--r-- | render/gles2/renderer.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/include/wlr/render/gles2.h b/include/wlr/render/gles2.h index 5bdf6edb..a97b495c 100644 --- a/include/wlr/render/gles2.h +++ b/include/wlr/render/gles2.h @@ -30,6 +30,7 @@ struct wlr_gles2_texture_attribs { bool has_alpha; }; +bool wlr_renderer_is_gles2(struct wlr_renderer *wlr_renderer); bool wlr_texture_is_gles2(struct wlr_texture *texture); void wlr_gles2_texture_get_attribs(struct wlr_texture *texture, struct wlr_gles2_texture_attribs *attribs); diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c index 458d172f..dad18975 100644 --- a/render/gles2/renderer.c +++ b/render/gles2/renderer.c @@ -28,9 +28,13 @@ static const GLfloat verts[] = { static const struct wlr_renderer_impl renderer_impl; +bool wlr_renderer_is_gles2(struct wlr_renderer *wlr_renderer) { + return wlr_renderer->impl == &renderer_impl; +} + struct wlr_gles2_renderer *gles2_get_renderer( struct wlr_renderer *wlr_renderer) { - assert(wlr_renderer->impl == &renderer_impl); + assert(wlr_renderer_is_gles2(wlr_renderer)); return (struct wlr_gles2_renderer *)wlr_renderer; } |