aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/wlr/render/interface.h4
-rw-r--r--include/wlr/types/wlr_region.h6
-rw-r--r--include/wlr/types/wlr_surface.h16
-rw-r--r--include/wlr/util/list.h2
4 files changed, 24 insertions, 4 deletions
diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h
index 59ece8b1..f98c3bc2 100644
--- a/include/wlr/render/interface.h
+++ b/include/wlr/render/interface.h
@@ -46,6 +46,8 @@ struct wlr_texture_impl {
struct wl_resource *drm_buf);
void (*get_matrix)(struct wlr_texture *state,
float (*matrix)[16], const float (*projection)[16], int x, int y);
+ void (*get_buffer_size)(struct wlr_texture *texture,
+ struct wl_resource *resource, int *width, int *height);
void (*bind)(struct wlr_texture *texture);
void (*destroy)(struct wlr_texture *texture);
};
@@ -53,5 +55,7 @@ struct wlr_texture_impl {
void wlr_texture_init(struct wlr_texture *texture,
struct wlr_texture_impl *impl);
void wlr_texture_bind(struct wlr_texture *texture);
+void wlr_texture_get_buffer_size(struct wlr_texture *texture,
+ struct wl_resource *resource, int *width, int *height);
#endif
diff --git a/include/wlr/types/wlr_region.h b/include/wlr/types/wlr_region.h
index 0aff48a3..9a64ac13 100644
--- a/include/wlr/types/wlr_region.h
+++ b/include/wlr/types/wlr_region.h
@@ -3,8 +3,10 @@
struct wl_resource;
-// Implements the given resource as region.
-// Sets the associated pixman_region32_t as userdata.
+/*
+ * Implements the given resource as region.
+ * Sets the associated pixman_region32_t as userdata.
+ */
void wlr_region_create(struct wl_client *client, struct wl_resource *res,
uint32_t id);
diff --git a/include/wlr/types/wlr_surface.h b/include/wlr/types/wlr_surface.h
index 60d8b2f6..9b13d9cc 100644
--- a/include/wlr/types/wlr_surface.h
+++ b/include/wlr/types/wlr_surface.h
@@ -23,8 +23,10 @@ struct wlr_surface_state {
int32_t sx, sy;
pixman_region32_t surface_damage, buffer_damage;
pixman_region32_t opaque, input;
- uint32_t transform;
+ enum wl_output_transform transform;
int32_t scale;
+ int width, height;
+ int buffer_width, buffer_height;
};
struct wlr_surface {
@@ -53,5 +55,17 @@ struct wlr_renderer;
struct wlr_surface *wlr_surface_create(struct wl_resource *res,
struct wlr_renderer *renderer);
void wlr_surface_flush_damage(struct wlr_surface *surface);
+/**
+ * Gets a matrix you can pass into wlr_render_with_matrix to display this
+ * surface. `matrix` is the output matrix, `projection` is the wlr_output
+ * projection matrix, and `transform` is any additional transformations you want
+ * to perform on the surface (or NULL/the identity matrix if you don't).
+ * `transform` is used before the surface is scaled, so its geometry extends
+ * from 0 to 1 in both dimensions.
+ */
+void wlr_surface_get_matrix(struct wlr_surface *surface,
+ float (*matrix)[16],
+ const float (*projection)[16],
+ const float (*transform)[16]);
#endif
diff --git a/include/wlr/util/list.h b/include/wlr/util/list.h
index c82fbf7a..0c175132 100644
--- a/include/wlr/util/list.h
+++ b/include/wlr/util/list.h
@@ -11,7 +11,7 @@ typedef struct {
list_t *list_create(void);
void list_free(list_t *list);
-void list_foreach(list_t *list, void (*callback)(void* item));
+void list_foreach(list_t *list, void (*callback)(void *item));
void list_add(list_t *list, void *item);
void list_push(list_t *list, void *item);
void list_insert(list_t *list, size_t index, void *item);