|
|
|
@ -16,7 +16,7 @@
|
|
|
|
|
|
|
|
|
|
static const struct wlr_texture_impl texture_impl;
|
|
|
|
|
|
|
|
|
|
static struct wlr_gles2_texture *gles2_get_texture(
|
|
|
|
|
struct wlr_gles2_texture *gles2_get_texture(
|
|
|
|
|
struct wlr_texture *wlr_texture) {
|
|
|
|
|
assert(wlr_texture->impl == &texture_impl);
|
|
|
|
|
return (struct wlr_gles2_texture *)wlr_texture;
|
|
|
|
@ -25,7 +25,9 @@ static struct wlr_gles2_texture *gles2_get_texture(
|
|
|
|
|
struct wlr_gles2_texture *get_gles2_texture_in_context(
|
|
|
|
|
struct wlr_texture *wlr_texture) {
|
|
|
|
|
struct wlr_gles2_texture *texture = gles2_get_texture(wlr_texture);
|
|
|
|
|
assert(wlr_egl_is_current(texture->egl));
|
|
|
|
|
if (!wlr_egl_is_current(texture->egl)) {
|
|
|
|
|
wlr_egl_make_current(texture->egl, EGL_NO_SURFACE, NULL);
|
|
|
|
|
}
|
|
|
|
|
return texture;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -143,7 +145,9 @@ static const struct wlr_texture_impl texture_impl = {
|
|
|
|
|
struct wlr_texture *wlr_gles2_texture_from_pixels(struct wlr_egl *egl,
|
|
|
|
|
enum wl_shm_format wl_fmt, uint32_t stride, uint32_t width,
|
|
|
|
|
uint32_t height, const void *data) {
|
|
|
|
|
assert(wlr_egl_is_current(egl));
|
|
|
|
|
if (!wlr_egl_is_current(egl)) {
|
|
|
|
|
wlr_egl_make_current(egl, EGL_NO_SURFACE, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const struct wlr_gles2_pixel_format *fmt = get_gles2_format_from_wl(wl_fmt);
|
|
|
|
|
if (fmt == NULL) {
|
|
|
|
@ -180,7 +184,9 @@ struct wlr_texture *wlr_gles2_texture_from_pixels(struct wlr_egl *egl,
|
|
|
|
|
|
|
|
|
|
struct wlr_texture *wlr_gles2_texture_from_wl_drm(struct wlr_egl *egl,
|
|
|
|
|
struct wl_resource *data) {
|
|
|
|
|
assert(wlr_egl_is_current(egl));
|
|
|
|
|
if (!wlr_egl_is_current(egl)) {
|
|
|
|
|
wlr_egl_make_current(egl, EGL_NO_SURFACE, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!glEGLImageTargetTexture2DOES) {
|
|
|
|
|
return NULL;
|
|
|
|
@ -239,7 +245,9 @@ struct wlr_texture *wlr_gles2_texture_from_wl_drm(struct wlr_egl *egl,
|
|
|
|
|
|
|
|
|
|
struct wlr_texture *wlr_gles2_texture_from_dmabuf(struct wlr_egl *egl,
|
|
|
|
|
struct wlr_dmabuf_attributes *attribs) {
|
|
|
|
|
assert(wlr_egl_is_current(egl));
|
|
|
|
|
if (!wlr_egl_is_current(egl)) {
|
|
|
|
|
wlr_egl_make_current(egl, EGL_NO_SURFACE, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!glEGLImageTargetTexture2DOES) {
|
|
|
|
|
return NULL;
|
|
|
|
|