aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/wlr/render/gles2.h1
-rw-r--r--render/gles2/renderer.c6
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;
}