aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
authornyorain <nyorain@gmail.com>2017-08-09 21:25:34 +0200
committernyorain <nyorain@gmail.com>2017-08-10 10:59:58 +0200
commit67369173aaafd763a6369a84917ae457c7095a72 (patch)
treec42bbcebd5b1e972c422386ce46f353c2f3a31ca /include/wlr
parent750d0ad4583732ee24c998f46a62fc684f86bc48 (diff)
Implement drm (egl) buffer attaching
Diffstat (limited to 'include/wlr')
-rw-r--r--include/wlr/render.h13
-rw-r--r--include/wlr/render/gles2.h1
-rw-r--r--include/wlr/render/interface.h3
3 files changed, 14 insertions, 3 deletions
diff --git a/include/wlr/render.h b/include/wlr/render.h
index 61169333..47e2ff57 100644
--- a/include/wlr/render.h
+++ b/include/wlr/render.h
@@ -65,7 +65,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 +80,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,
diff --git a/include/wlr/render/gles2.h b/include/wlr/render/gles2.h
index a779ffff..43d4719e 100644
--- a/include/wlr/render/gles2.h
+++ b/include/wlr/render/gles2.h
@@ -2,6 +2,7 @@
#define _WLR_GLES2_RENDERER_H
#include <wlr/render.h>
+struct wlr_egl;
struct wlr_renderer *wlr_gles2_renderer_init();
#endif
diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h
index be9ffe7a..4a4b22e2 100644
--- a/include/wlr/render/interface.h
+++ b/include/wlr/render/interface.h
@@ -42,7 +42,8 @@ struct wlr_texture_impl {
struct wl_shm_buffer *shm);
bool (*update_shm)(struct wlr_texture_state *surf, uint32_t format,
int x, int y, int width, int height, struct wl_shm_buffer *shm);
- // TODO: egl
+ bool (*upload_drm)(struct wlr_texture_state *state,
+ struct wl_resource *drm_buf);
void (*get_matrix)(struct wlr_texture_state *state,
float (*matrix)[16], const float (*projection)[16], int x, int y);
void (*bind)(struct wlr_texture_state *state);