aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
Diffstat (limited to 'include/wlr')
-rw-r--r--include/wlr/render/interface.h4
-rw-r--r--include/wlr/render/wlr_renderer.h16
-rw-r--r--include/wlr/types/wlr_box.h2
-rw-r--r--include/wlr/types/wlr_xdg_shell.h3
-rw-r--r--include/wlr/types/wlr_xdg_shell_v6.h3
-rw-r--r--include/wlr/util/region.h7
6 files changed, 29 insertions, 6 deletions
diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h
index 7f25c0ff..d4cd35f8 100644
--- a/include/wlr/render/interface.h
+++ b/include/wlr/render/interface.h
@@ -27,9 +27,9 @@ struct wlr_renderer_impl {
bool (*render_texture_with_matrix)(struct wlr_renderer *renderer,
struct wlr_texture *texture, const float matrix[static 9],
float alpha);
- void (*render_quad)(struct wlr_renderer *renderer,
+ void (*render_quad_with_matrix)(struct wlr_renderer *renderer,
const float color[static 4], const float matrix[static 9]);
- void (*render_ellipse)(struct wlr_renderer *renderer,
+ void (*render_ellipse_with_matrix)(struct wlr_renderer *renderer,
const float color[static 4], const float matrix[static 9]);
const enum wl_shm_format *(*formats)(
struct wlr_renderer *renderer, size_t *len);
diff --git a/include/wlr/render/wlr_renderer.h b/include/wlr/render/wlr_renderer.h
index 6f0d2ecc..5c78089e 100644
--- a/include/wlr/render/wlr_renderer.h
+++ b/include/wlr/render/wlr_renderer.h
@@ -36,14 +36,24 @@ bool wlr_render_texture(struct wlr_renderer *r, struct wlr_texture *texture,
bool wlr_render_texture_with_matrix(struct wlr_renderer *r,
struct wlr_texture *texture, const float matrix[static 9], float alpha);
/**
- * Renders a solid quad in the specified color.
+ * Renders a solid rectangle in the specified color.
*/
-void wlr_render_colored_quad(struct wlr_renderer *r,
+void wlr_render_rect(struct wlr_renderer *r, const struct wlr_box *box,
+ const float color[static 4], const float projection[static 9]);
+/**
+ * Renders a solid quadrangle in the specified color with the specified matrix.
+ */
+void wlr_render_quad_with_matrix(struct wlr_renderer *r,
const float color[static 4], const float matrix[static 9]);
/**
* Renders a solid ellipse in the specified color.
*/
-void wlr_render_colored_ellipse(struct wlr_renderer *r,
+void wlr_render_ellipse(struct wlr_renderer *r, const struct wlr_box *box,
+ const float color[static 4], const float projection[static 9]);
+/**
+ * Renders a solid ellipse in the specified color with the specified matrix.
+ */
+void wlr_render_ellipse_with_matrix(struct wlr_renderer *r,
const float color[static 4], const float matrix[static 9]);
/**
* Returns a list of pixel formats supported by this renderer.
diff --git a/include/wlr/types/wlr_box.h b/include/wlr/types/wlr_box.h
index fc86f0ac..0e586a18 100644
--- a/include/wlr/types/wlr_box.h
+++ b/include/wlr/types/wlr_box.h
@@ -27,7 +27,7 @@ void wlr_box_transform(const struct wlr_box *box,
struct wlr_box *dest);
/**
- * Creates the smallest box that contains a rotated box.
+ * Creates the smallest box that contains the box rotated about its center.
*/
void wlr_box_rotated_bounds(const struct wlr_box *box, float rotation,
struct wlr_box *dest);
diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h
index 410663f7..fa808b60 100644
--- a/include/wlr/types/wlr_xdg_shell.h
+++ b/include/wlr/types/wlr_xdg_shell.h
@@ -40,6 +40,9 @@ struct wlr_xdg_popup {
bool committed;
struct wlr_xdg_surface *parent;
struct wlr_seat *seat;
+
+ // Position of the popup relative to the upper left corner of the window
+ // geometry of the parent surface
struct wlr_box geometry;
struct wl_list grab_link; // wlr_xdg_popup_grab::popups
diff --git a/include/wlr/types/wlr_xdg_shell_v6.h b/include/wlr/types/wlr_xdg_shell_v6.h
index 3bfb97a4..ae3986ed 100644
--- a/include/wlr/types/wlr_xdg_shell_v6.h
+++ b/include/wlr/types/wlr_xdg_shell_v6.h
@@ -40,6 +40,9 @@ struct wlr_xdg_popup_v6 {
bool committed;
struct wlr_xdg_surface_v6 *parent;
struct wlr_seat *seat;
+
+ // Position of the popup relative to the upper left corner of the window
+ // geometry of the parent surface
struct wlr_box geometry;
struct wl_list grab_link; // wlr_xdg_popup_grab_v6::popups
diff --git a/include/wlr/util/region.h b/include/wlr/util/region.h
index 7883af97..c0fe6063 100644
--- a/include/wlr/util/region.h
+++ b/include/wlr/util/region.h
@@ -26,4 +26,11 @@ void wlr_region_transform(pixman_region32_t *dst, pixman_region32_t *src,
void wlr_region_expand(pixman_region32_t *dst, pixman_region32_t *src,
int distance);
+/*
+ * Builds the smallest possible region that contains the region rotated about
+ * the point (ox, oy).
+ */
+void wlr_region_rotated_bounds(pixman_region32_t *dst, pixman_region32_t *src,
+ float rotation, int ox, int oy);
+
#endif