aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-01-29 23:24:09 +0100
committeremersion <contact@emersion.fr>2018-01-29 23:24:09 +0100
commit51c22d39a4a1a3c4ecfe39ee3df90ba7e66633af (patch)
treeb9fd9fd6fddc8a869f3500bf92944b47c01c578c /include
parent2cc989e09716eed5974dc9a76b7b6dbee9c3d730 (diff)
parented5b1fdedd775a7acec3d6814cc2ac007e34fd29 (diff)
Merge remote-tracking branch 'upstream/master' into output-damage
Diffstat (limited to 'include')
-rw-r--r--include/backend/headless.h1
-rw-r--r--include/backend/wayland.h2
-rw-r--r--include/backend/x11.h1
-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
8 files changed, 23 insertions, 8 deletions
diff --git a/include/backend/headless.h b/include/backend/headless.h
index f1948c07..f9805bcc 100644
--- a/include/backend/headless.h
+++ b/include/backend/headless.h
@@ -7,6 +7,7 @@
struct wlr_headless_backend {
struct wlr_backend backend;
struct wlr_egl egl;
+ struct wlr_renderer *renderer;
struct wl_display *display;
struct wl_list outputs;
struct wl_list input_devices;
diff --git a/include/backend/wayland.h b/include/backend/wayland.h
index e14e000c..78a88f29 100644
--- a/include/backend/wayland.h
+++ b/include/backend/wayland.h
@@ -6,6 +6,7 @@
#include <wayland-server.h>
#include <wayland-egl.h>
#include <wlr/render/egl.h>
+#include <wlr/render.h>
#include <wlr/backend/wayland.h>
#include <wlr/types/wlr_box.h>
#include <wayland-util.h>
@@ -19,6 +20,7 @@ struct wlr_wl_backend {
struct wl_list devices;
struct wl_list outputs;
struct wlr_egl egl;
+ struct wlr_renderer *renderer;
size_t requested_outputs;
struct wl_listener local_display_destroy;
/* remote state */
diff --git a/include/backend/x11.h b/include/backend/x11.h
index b342cd4d..fee39eac 100644
--- a/include/backend/x11.h
+++ b/include/backend/x11.h
@@ -39,6 +39,7 @@ struct wlr_x11_backend {
struct wlr_input_device pointer_dev;
struct wlr_egl egl;
+ struct wlr_renderer *renderer;
struct wl_event_source *event_source;
struct wl_event_source *frame_timer;
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