glamor: Add glamor_egl_untexture_pixmap

Undoes `glamor_egl_create_textured_pixmap_from_gbm_bo` and friends

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
This commit is contained in:
stefan11111 2026-10-05 21:22:06 +03:00 • committed by Enrico Weigelt
commit e6a027c5ad
4 changed files with 17 additions and 0 deletions

View file

@ -138,6 +138,10 @@ glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int tex)
glamor_destroy_fbo(glamor_priv, fbo);
}
if (!tex) {
return TRUE;
}
fbo = glamor_create_fbo_from_tex(glamor_priv, pixmap,
pixmap->drawable.width,
pixmap->drawable.height, tex, 0);

View file

@ -655,6 +655,14 @@ glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap,
#endif
}
void
glamor_egl_untexture_pixmap(PixmapPtr pixmap, int type)
{
glamor_egl_set_pixmap_image(pixmap, EGL_NO_IMAGE_KHR, FALSE /* used_modifiers */);
glamor_set_pixmap_texture(pixmap, 0);
glamor_set_pixmap_type(pixmap, type);
}
#if defined(GLAMOR_HAS_GBM) && defined(WITH_LIBDRM)
static void
glamor_get_name_from_bo(int gbm_fd, struct gbm_bo *bo, int *name)

View file

@ -131,4 +131,8 @@ glamor_egl_get_display(EGLint type, void *native)
int glamor_egl_get_fd(ScreenPtr screen);
/* This should probably be _X_EXPORT'ed */
void
glamor_egl_untexture_pixmap(PixmapPtr pixmap, int type);
#endif

View file

@ -279,6 +279,7 @@ glamor_pixmap_detach_fbo(glamor_pixmap_private *pixmap_priv)
return NULL;
pixmap_priv->fbo = NULL;
pixmap_priv->gl_fbo = GLAMOR_FBO_UNATTACHED;
return fbo;
}