aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
Diffstat (limited to 'include/wlr')
-rw-r--r--include/wlr/backend.h1
-rw-r--r--include/wlr/backend/interface.h1
-rw-r--r--include/wlr/render.h13
-rw-r--r--include/wlr/render/interface.h8
-rw-r--r--include/wlr/types/wlr_screenshooter.h4
5 files changed, 19 insertions, 8 deletions
diff --git a/include/wlr/backend.h b/include/wlr/backend.h
index 4632dcbf..d4b1f773 100644
--- a/include/wlr/backend.h
+++ b/include/wlr/backend.h
@@ -23,6 +23,7 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display);
bool wlr_backend_start(struct wlr_backend *backend);
void wlr_backend_destroy(struct wlr_backend *backend);
struct wlr_egl *wlr_backend_get_egl(struct wlr_backend *backend);
+struct wlr_renderer *wlr_backend_get_renderer(struct wlr_backend *backend);
uint32_t usec_to_msec(uint64_t usec);
diff --git a/include/wlr/backend/interface.h b/include/wlr/backend/interface.h
index 3f0aaadb..d9212795 100644
--- a/include/wlr/backend/interface.h
+++ b/include/wlr/backend/interface.h
@@ -9,6 +9,7 @@ struct wlr_backend_impl {
bool (*start)(struct wlr_backend *backend);
void (*destroy)(struct wlr_backend *backend);
struct wlr_egl *(*get_egl)(struct wlr_backend *backend);
+ struct wlr_renderer *(*get_renderer)(struct wlr_backend *backend);
};
void wlr_backend_init(struct wlr_backend *backend,
diff --git a/include/wlr/render.h b/include/wlr/render.h
index bfd9e829..46ee0fa3 100644
--- a/include/wlr/render.h
+++ b/include/wlr/render.h
@@ -56,10 +56,17 @@ const enum wl_shm_format *wlr_renderer_get_formats(
bool wlr_renderer_buffer_is_drm(struct wlr_renderer *renderer,
struct wl_resource *buffer);
/**
- * Reads pixels and stores them in out_data as ARGB8888.
+ * Reads out of pixels of the currently bound surface into data. `stride` is in
+ * bytes.
*/
-void wlr_renderer_read_pixels(struct wlr_renderer *r, int x, int y,
- int width, int height, void *out_data);
+bool wlr_renderer_read_pixels(struct wlr_renderer *r, enum wl_shm_format fmt,
+ uint32_t stride, uint32_t width, uint32_t height,
+ uint32_t src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y, void *data);
+/**
+ * Checks if a format is supported.
+ */
+bool wlr_renderer_format_supported(struct wlr_renderer *r,
+ enum wl_shm_format fmt);
/**
* Destroys this wlr_renderer. Textures must be destroyed separately.
*/
diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h
index 3927795d..2531f33c 100644
--- a/include/wlr/render/interface.h
+++ b/include/wlr/render/interface.h
@@ -32,8 +32,12 @@ struct wlr_renderer_impl {
struct wlr_renderer *renderer, size_t *len);
bool (*buffer_is_drm)(struct wlr_renderer *renderer,
struct wl_resource *buffer);
- void (*read_pixels)(struct wlr_renderer *renderer, int x, int y, int width,
- int height, void *out_data);
+ bool (*read_pixels)(struct wlr_renderer *renderer, enum wl_shm_format fmt,
+ uint32_t stride, uint32_t width, uint32_t height,
+ uint32_t src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y,
+ void *data);
+ bool (*format_supported)(struct wlr_renderer *renderer,
+ enum wl_shm_format fmt);
void (*destroy)(struct wlr_renderer *renderer);
};
diff --git a/include/wlr/types/wlr_screenshooter.h b/include/wlr/types/wlr_screenshooter.h
index 4c66be3f..cfe7742d 100644
--- a/include/wlr/types/wlr_screenshooter.h
+++ b/include/wlr/types/wlr_screenshooter.h
@@ -4,7 +4,6 @@
struct wlr_screenshooter {
struct wl_global *wl_global;
- struct wlr_renderer *renderer;
struct wl_list screenshots; // wlr_screenshot::link
struct wl_listener display_destroy;
@@ -23,8 +22,7 @@ struct wlr_screenshot {
void* data;
};
-struct wlr_screenshooter *wlr_screenshooter_create(struct wl_display *display,
- struct wlr_renderer *renderer);
+struct wlr_screenshooter *wlr_screenshooter_create(struct wl_display *display);
void wlr_screenshooter_destroy(struct wlr_screenshooter *screenshooter);
#endif