From fdc40e071ed103d6bdc03fa6181dedef296b0509 Mon Sep 17 00:00:00 2001 From: zccrs Date: Fri, 28 May 2021 14:06:49 +0800 Subject: render/gles2: add wlr_renderer_is_gles2 Export the interface used to determine whether the wlr_renderer object is gles2. --- render/gles2/renderer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'render/gles2') 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; } -- cgit v1.2.3