diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-08-10 22:20:21 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-10 22:20:21 -0400 |
commit | 6569c2b62614384b268eb20feb7818f3c0cf606c (patch) | |
tree | 4be63a8f4e2edfcecd228f23e9846403ddf39281 /include/wlr/render.h | |
parent | fe2fbd0fad96624ab64a86b0b8eb8ead769908f2 (diff) | |
parent | c24351681f672a2ce561b9cb6d73172dfc36c45c (diff) |
Merge pull request #53 from nyorain/drm_buffer
Implement drm (egl) buffer attaching
Diffstat (limited to 'include/wlr/render.h')
-rw-r--r-- | include/wlr/render.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/wlr/render.h b/include/wlr/render.h index 61169333..5e9f889e 100644 --- a/include/wlr/render.h +++ b/include/wlr/render.h @@ -44,6 +44,11 @@ void wlr_render_colored_ellipse(struct wlr_renderer *r, const enum wl_shm_format *wlr_renderer_get_formats( struct wlr_renderer *r, size_t *len); /** + * Returns true if this wl_buffer is a DRM buffer. + */ +bool wlr_renderer_buffer_is_drm(struct wlr_renderer *renderer, + struct wl_resource *buffer); +/** * Destroys this wlr_renderer. Textures must be destroyed separately. */ void wlr_renderer_destroy(struct wlr_renderer *renderer); @@ -65,7 +70,7 @@ struct wlr_texture { * Copies pixels to this texture. The buffer is not accessed after this function * returns. */ -bool wlr_texture_upload_pixels(struct wlr_texture *surf, +bool wlr_texture_upload_pixels(struct wlr_texture *tex, enum wl_shm_format format, int stride, int width, int height, const unsigned char *pixels); /** @@ -80,8 +85,17 @@ bool wlr_texture_update_pixels(struct wlr_texture *surf, * Copies pixels from a wl_shm_buffer into this texture. The buffer is not * accessed after this function returns. */ -bool wlr_texture_upload_shm(struct wlr_texture *surf, uint32_t format, +bool wlr_texture_upload_shm(struct wlr_texture *tex, uint32_t format, struct wl_shm_buffer *shm); + +/** + * Attaches the contents from the given wl_drm wl_buffer resource onto the + * texture. The wl_resource is not used after this call. + * Will fail (return false) if the given resource is no drm buffer. + */ + bool wlr_texture_upload_drm(struct wlr_texture *tex, + struct wl_resource *drm_buffer); + /** * Copies a rectangle of pixels from a wl_shm_buffer onto the texture. The * buffer is not accessed after this function returns. Under some circumstances, |