render/gles2: add wlr_renderer_is_gles2
Export the interface used to determine whether the wlr_renderer object is gles2.
This commit is contained in:
parent
103edde481
commit
fdc40e071e
|
@ -30,6 +30,7 @@ struct wlr_gles2_texture_attribs {
|
||||||
bool has_alpha;
|
bool has_alpha;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bool wlr_renderer_is_gles2(struct wlr_renderer *wlr_renderer);
|
||||||
bool wlr_texture_is_gles2(struct wlr_texture *texture);
|
bool wlr_texture_is_gles2(struct wlr_texture *texture);
|
||||||
void wlr_gles2_texture_get_attribs(struct wlr_texture *texture,
|
void wlr_gles2_texture_get_attribs(struct wlr_texture *texture,
|
||||||
struct wlr_gles2_texture_attribs *attribs);
|
struct wlr_gles2_texture_attribs *attribs);
|
||||||
|
|
|
@ -28,9 +28,13 @@ static const GLfloat verts[] = {
|
||||||
|
|
||||||
static const struct wlr_renderer_impl renderer_impl;
|
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_gles2_renderer *gles2_get_renderer(
|
||||||
struct wlr_renderer *wlr_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;
|
return (struct wlr_gles2_renderer *)wlr_renderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue