wlr_raster: Add surface helper

This commit is contained in:
Alexander Orzechowski 2024-09-14 17:16:28 -04:00
parent d9f6ec080f
commit 46b0ba0da6
2 changed files with 150 additions and 0 deletions

View file

@ -17,6 +17,7 @@ struct wlr_buffer;
struct wlr_texture;
struct wlr_renderer;
struct wlr_drm_syncobj_timeline;
struct wlr_surface;
struct wlr_raster {
// May be NULL
@ -83,4 +84,12 @@ void wlr_raster_unlock(struct wlr_raster *raster);
struct wlr_texture *wlr_raster_obtain_texture(struct wlr_raster *raster,
struct wlr_renderer *renderer);
/**
* Creates a wlr_raster from a surface. This will automatically deduplicate
* rasters if multiple are consumed from the same surface so that redundant
* uploads are not performed. The raster returned will automatically be locked.
* Users are required to call wlr_raster_unlock() after invoking this function.
*/
struct wlr_raster *wlr_raster_from_surface(struct wlr_surface *surface);
#endif